Viewing 15 posts - 6,091 through 6,105 (of 7,631 total)
Question: are you using CHAR or VARCHAR? I ask because RTRIM and LTRIM probably do not work the way you expect for CHAR. Remember, they're not variable in...
[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]
August 3, 2008 at 8:52 pm
Right. The resource hit to do this in the database is not usually significant, however, it does "uglify" the code and lead to secondary costs as Jeff W pointed...
[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]
August 3, 2008 at 5:59 pm
For many years I worked as a Capacity Planning Consultant, first for Digital, then later on my own. Capacity planning is a lost art now, but was pretty big...
[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]
August 3, 2008 at 5:45 pm
Heh, right. The section with the cursor is not necessary, just delete it.
[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]
August 3, 2008 at 10:44 am
This should do it:
;With cteServers as (
Select server
, logical_disk
, Row_Number() Over(Partition by server, order by logical_disk) as N
From Servers
)
Select...
[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]
August 3, 2008 at 10:40 am
Oh yeah, I remember that one from way back. Heh.
[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]
August 3, 2008 at 1:18 am
Actually, after re-reading your original post, I think that I misunderstood what you were asking for and that Jeff is right.
[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]
August 3, 2008 at 1:13 am
Oops, sorry. Didn't see this until now. Well, glad you worked it out...
[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]
August 3, 2008 at 1:08 am
Try this:
--====== Change Cursor to Temp table
Select Identity() as ID
, *
--move all of the temp variables here too
, Coalesce((SELECT MSALESNBR
FROM USER_STAGE.dbo.BOOKING_FACT_EXT_CUSTOMER
WHERE MSALESNBR = TMSalesNbr
), 0) as TMTo1Flag
,...
[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]
August 3, 2008 at 12:30 am
What's the maximum number of logical drives per server?
[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]
August 2, 2008 at 7:12 pm
There is no security in obscurity.
Post it.
[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]
August 2, 2008 at 6:51 pm
Of course, the order problem can be easily remedied if you just add an Identity column. 🙂
[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]
August 2, 2008 at 6:46 pm
SELECT distinct R1.FlightNum, R1.ToCityCode, R2.FromCityCode
FROM Flights R1,...
[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]
August 2, 2008 at 1:26 pm
Jeff Moden (8/2/2008)
The DBA was nothing but a BSOFH.;)
Uuuhh, ... "Big Stupid Old Fart-Head"?
[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]
August 2, 2008 at 1:07 pm
This should work:
;With cteTable1 as (
Select Row_Number() OVER(Partition by Prod Order by 1) as Row
, Count(*) OVER(Partition by Prod) as Cnt
, Prod
, Description
From table1
),
cteIterate as (
Select Row, Cnt,...
[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]
August 2, 2008 at 12:56 pm
Viewing 15 posts - 6,091 through 6,105 (of 7,631 total)