Viewing 15 posts - 3,391 through 3,405 (of 5,588 total)
David Burrows (9/2/2010)
WayneS (9/2/2010)
Bezan,David's solution rocks. Just use that.
Thanks Wayne :blush:
Not sure that it rocks, might need a bit of fine tuning 🙂
The only area of improvement that I can...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 2, 2010 at 9:48 am
Check the registry. On my system, it's located at:
HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\100\Tools\ClientSetup, and the key is SQLToolsPath.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 2, 2010 at 9:39 am
Does this get you what you're looking for?
SELECT dti.Dat_Date, i.In_ID
FROM (
SELECT *
...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 2, 2010 at 9:36 am
To see the value of any variable, just select @variable.
To see the contents of temp tables, just select * from #temptable.
Of course, this will need to be done within the...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 2, 2010 at 8:30 am
I would suggest adding a "select @ExistingID" to the end of your code, and see what you get.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 2, 2010 at 8:14 am
Bezan,
David's solution rocks. Just use that.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 2, 2010 at 8:11 am
Click here for the latest Delimited Split Function.
Then, it's just:
SELECT ITEM
FROM dbo.DelimitedSplit8k(@val, ',')
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 2, 2010 at 8:10 am
David Burrows (9/2/2010)
Here's my attempt at a solution
Whoa... VERY NICE!
Edit: I really like using the dates in the case statements... kinda obvious when you see it.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 2, 2010 at 8:00 am
Bezan,
I've really enjoyed this exercise. It's nice to see someone that isn't posting "do it all for me" - you are working the problem, reading what is being suggested, implementing...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 2, 2010 at 7:50 am
I just modified it to combine all the sql generation that runs against the tally table to run in just one select statement - reducing the # of reads against...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 2, 2010 at 7:46 am
Bezan (9/2/2010)
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 2, 2010 at 7:34 am
irobertson (9/2/2010)
Interestingly, as I increase the amount of data in the table, the number of logical reads on the cte solution increases. Any idea why?
Yes - you're calling CTE2 5...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 2, 2010 at 7:25 am
LightVader (9/2/2010)
Derrick Smith (9/1/2010)
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 2, 2010 at 7:22 am
Check your dmv's for missing indexes.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 2, 2010 at 7:15 am
What I generally do is to add a parameter to the procedure:
@debug tinyint = 0
Then, within the code, do things like:
if @debug > 0 select ....
if @debug > 1 select...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 2, 2010 at 7:13 am
Viewing 15 posts - 3,391 through 3,405 (of 5,588 total)