Viewing 15 posts - 76 through 90 (of 1,473 total)
At first glance, this doesn't seem like just a simple unpivot. I'm assuming this is just an issue in your sample data, but you don't have any field in...
February 4, 2011 at 1:17 pm
We end up pulling data from Oracle quite often. SQL Server can create Linked Servers To Oracle, and you can also use OPENQUERY to pull data across.
Here...
February 4, 2011 at 1:05 pm
Greetings,
Please refer to the link in my signature on how to provide usable sample data.
February 4, 2011 at 12:35 pm
Sorry if this is oversimplifying your query, but do you just mean:
SELECT * FROM Table1 EXCEPT (SELECT * FROM Table2) ?
Example:
CREATE TABLE #A(
a int,
b int)
INSERT INTO #A SELECT 5,1
INSERT INTO...
February 2, 2011 at 11:26 am
This should work. See the link in my signature on Crosstabs/pivots for additional information on how this works.
DECLARE @x xml
SELECT @x='<MoreProperties>
<Property>
<Key>property1</Key>
<Value>value1</Value>
</Property>
<Property>
<Key>property2</Key>
<Value>value2</Value>
</Property>
<Property>
<Key>property3</Key>
<Value>value3</Value>
</Property>
<Property>
<Key>property4</Key>
<Value>value4</Value>
</Property>
</MoreProperties>'
;WITH A AS (
select
n.value('Key[1]','varchar(30)') as [Key],
n.value('Value[1]','varchar(30)') as [Value]
FROM...
January 31, 2011 at 9:10 am
Glad I could help. As to the explanations:
The ';WITH C1 AS' is the beginning declaration of a Common Table Expression (or CTE). In this case it's a recursive...
January 31, 2011 at 6:28 am
Thanks for the sample data. This should do the trick.
Note that this won't work until you fix the 'NULL' in your sample data to be just NULL instead.
;WITH C1...
January 28, 2011 at 2:57 pm
As Mike said, you'll get better, faster results posting usable sample data in the fashion he supplies below. That said, I had a few minutes to kill, so here's...
January 28, 2011 at 2:15 pm
I'm quite sure this could be cleaned up a lot, but here's one quick solution. This should work on 2005+. As a side note, thanks so much for...
June 16, 2010 at 5:18 pm
Martin,
Chris was suggesting this book:
http://www.amazon.co.uk/Microsoft-SQL-Server-2008-Dummies/dp/0470224657 You can pick it up online. You can also get all of the books I listed on Amazon.
The Understanding and using APPLY (I)...
June 14, 2010 at 3:56 pm
I really need to write the blog post I was going to do on this, but in the interim, I'd have to also lend my vote to Itzik's book(s). ...
May 27, 2010 at 8:15 am
The performance hit is still *there* for a small number of rows, it's just much harder to see because you're probably dealing with milliseconds. The biggest problem with non...
May 25, 2010 at 7:41 am
Please refer to the article in my signature on how to post sample data.
May 25, 2010 at 7:36 am
Although the max recursion is only a bit over 32K, any change in criteria will restart that recursion. You could easily run it on millions of rows... or it...
May 24, 2010 at 9:19 am
Viewing 15 posts - 76 through 90 (of 1,473 total)