Viewing 15 posts - 10,141 through 10,155 (of 14,953 total)
I noticed that a lot of the pages here slowed down like crazy when the prettier code blocks were added in. There's a script that formats them, and I...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 6, 2009 at 6:53 am
I have to admit that I hate single-letter table aliases. I've seen them cause more confusion than I've ever seen them resolve. They're just a way for lazy...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 3, 2009 at 3:02 pm
YSLGuru (4/3/2009)
GSquared (4/3/2009)
select Col1, count(*)
from dbo.MyTable;
SQL Server will raise an error that Col1 is neither contained in a...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 3, 2009 at 2:38 pm
That's a pretty standard "adjacency hierarchy" and can be resolved in SQL 2005 by a recursive Common Table Expression. If you look up Common Table Expressions (CTEs) in Books...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 3, 2009 at 1:36 pm
It'll eliminate rows before running the UDF.
The main problem with UDF performance is that the query optimizer has a rough time estimating rows they'll return, so it assumes it'll be...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 3, 2009 at 1:30 pm
Yes, the documentation on T-SQL (and pretty much everything else that has to do with anything ever touched by human beings) could stand improvement. In large, major ways. ...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 3, 2009 at 1:27 pm
Can you provide the relevant table structure, some sample data, and a sample of what the output should look like? I'm having a little trouble visualizing what you're describing,...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 3, 2009 at 1:12 pm
Jason Miller (4/3/2009)
GSquared (4/3/2009)
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 3, 2009 at 1:05 pm
I have to ask how that solution would be better than an indexed view with a covering index for the query, which is what the first option seems to imply...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 3, 2009 at 12:57 pm
Jeff, I have to admit, I have a terrible tendency to give up on something/someone, then have some thought I just can't hold back on the subject, and feel the...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 3, 2009 at 12:32 pm
Can you post the code for that proc? The create script would be best.
There are parts on the execution plan that lead me to believe it would be possible...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 3, 2009 at 12:19 pm
Another refinement:
declare @max-2 float;
select @max-2 = 1.79E+308;
;with CTE (CTEID, Col1, Col2, Col3, Col4, Col5, Col6, Col7, Col8, Seq1, Seq2) as
(select t1.id, t1.Col1, t1.Col2, t1.Col3, t1.Col4, t1.Col5, t1.Col6, t1.Col7, t1.Col8,
count(*), case...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 3, 2009 at 10:09 am
Yeah, I realized that about the 9. Was mainly pointing it out because, otherwise, the OP is going to claim your solution can't possibly work, because of it. ...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 3, 2009 at 9:59 am
Simple-Talk.com has a pivot workshop by Phil and Robyn that has code for a dynamic pivot in SQL.
Personally, I view pivots as an application task. Reporting Services, Excel, etc.,...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 3, 2009 at 9:46 am
I'm with Grant on this one. You're going to be better off rebuilding the server than trying to repair it. Faster, and guarantees you aren't leaving any junk...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 3, 2009 at 9:34 am
Viewing 15 posts - 10,141 through 10,155 (of 14,953 total)