Viewing 15 posts - 6,421 through 6,435 (of 7,631 total)
Jeff Moden (6/29/2008)
... and, come to think of it... I think 1 Order By in the CTE will probably be enough, as well. 😉
I'll need some convincing on that one....
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
June 29, 2008 at 5:43 pm
Jeff Moden (6/29/2008)
Much better... now, with the TOP in the CTE, do you really need the WHERE clause?
Prolly not...
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
June 29, 2008 at 5:37 pm
Jeff Moden (6/29/2008)
rbarryyoung (6/29/2008)
Any of this cow left for me? 🙂Here is my entry (really just a tweak of Jeff's):
Nicely done, Barry... but I get numbers just a bit...
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
June 29, 2008 at 5:20 pm
One of the easier ways that you can do this is to write your own "wrapper" Proc for EXEC(string) (or for sp_ExecuteSQL), and then always have your Dynamic SQL call...
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
June 29, 2008 at 5:10 pm
Kimberly.Hahn (6/29/2008)
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
June 29, 2008 at 4:56 pm
On 2005, it's always been 11,000+ wherever I've looked.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
June 29, 2008 at 4:44 pm
Ack! Yeah, that does make sense...
OK, then this one runs in under a second:
Create table Dates(D datetime primary key clustered)
GO
Declare @FirstDate datetime
Declare @LastDate datetime
Declare @Days int
Set @FirstDate = Cast('1970-01-01'...
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
June 29, 2008 at 1:24 pm
Hey, did you get a chance to look at that draft yet?
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
June 29, 2008 at 1:06 pm
Any of this cow left for me? 🙂
Here is my entry (really just a tweak of Jeff's):
PRINT REPLICATE('=',100) ---------------------------------------------------------
DBCC FREEPROCCACHE
DBCC DROPCLEANBUFFERS
declare @root int
select @root = sqrt(@testsize)+1
PRINT '===== RBarryYoung''s Method'
SET...
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
June 29, 2008 at 1:05 pm
I just registered! I will definitely be there...
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
June 29, 2008 at 12:16 pm
Marks's approach reduces your number of where clauses from 125+ to 25+. Since each of those where clauses probably results in a Scan, this will lower your scan count...
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
June 29, 2008 at 11:18 am
And the funny things is, what I always liked the most about SQL was how easy it was. IMHO, it is a lot easier than any 3GL/OO language that...
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
June 29, 2008 at 10:58 am
Heh, don't suppose I'm getting my two points, eh?
Never mind, I'll take them from these replies. Besides, I wouldn't want any more "enlightened" posters accusing me of point-mongering.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
June 29, 2008 at 10:50 am
Here it is:http://www.sqlservercentral.com/Forums/Topic512477-338-1.aspx
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
June 29, 2008 at 10:25 am
I do this a lot also, and it has been my experience that you have to put TRY..CATCH in both the calling proc and the called proc.
There was a discussion...
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
June 29, 2008 at 10:21 am
Viewing 15 posts - 6,421 through 6,435 (of 7,631 total)