Viewing 15 posts - 3,076 through 3,090 (of 3,957 total)
Jeff -
I read this article last week and it was definitely an eye-opener. Great stuff!
It is always exceedingly important to know your tools and most especially their limitations.
Sorry I...
August 8, 2012 at 10:10 pm
Here's an article that shows how you can calculate a depreciation schedule for an asset using an rCTE: http://www.sqlservercentral.com/articles/T-SQL/90955/.
That example (among many others) is about mid-way through.
It can easily be...
August 8, 2012 at 9:59 pm
Jeff Moden (8/8/2012)
dwain.c (8/8/2012)
Jeff Moden (8/8/2012)
texpic (8/6/2012)
Didn't have to deal with gaps. The solutions here solved the issue. I have the list. Thanks to everyone!
If you're using...
August 8, 2012 at 8:37 pm
I do agree that less is usually better ... except of course when it's not. 😛
August 8, 2012 at 8:30 pm
An alternate to Lynn's solution may be something like this:
SELECT a.FlightNbr, a.DeptDateTime, a.Origin, a.Destination, a.FirstName, a.CustomerID
,a.SeatRow, HistoryAction
FROM (
SELECT FlightNbr, DeptDateTime, Origin, Destination,FirstName,...
August 8, 2012 at 8:27 pm
Jeff Moden (8/8/2012)
texpic (8/6/2012)
Didn't have to deal with gaps. The solutions here solved the issue. I have the list. Thanks to everyone!
If you're using the "counting" rCTE...
August 8, 2012 at 7:31 pm
Hmmm... Strange requirement indeed. If I'm understanding this correctly, a quirky update might do it.
Set up your table like this:
create table #abc
(insertid int, cityid int,...
August 8, 2012 at 7:24 pm
Brandie Tarvin (8/8/2012)
Politics in the States tend to raise high emotions.
Shoot man! You should see the bloody (and I mean that literally) politics in Thailand!
August 8, 2012 at 6:35 pm
Thanks for the feedback Prasad. Hope you find the CAV UNPIVOT useful someday.
In a continuing quest to understand what I'm seeing on performance I ran another test and thought...
August 8, 2012 at 7:09 am
All things considered, both of these approaches are incredibily fast.
I can't recall ever seeing a 1M row test harness return both CPU and elapsed ms in single digits before.
Nice work...
August 8, 2012 at 6:00 am
Cadavre (8/8/2012)
Do you not like GROUP BY ROLLUP ?
Actually, I perused the link you provided but couldn't think about how to use ROLLUP that way.
The performance test result is interesting.
Try...
August 8, 2012 at 5:27 am
Thanks Lynn! Apparently if I could read, I would've come up with this version instead:
;WITH Unpivoted AS (
SELECT SchoolCode, RaceCode, Code, Value
...
August 8, 2012 at 4:11 am
Here's a link to an article that covers passing in delimited strings to substitute for an array:
http://www.sqlservercentral.com/articles/T-SQL/63003/
Another great one by Jeff Moden!
August 8, 2012 at 4:09 am
You can try something like this, although I don't get the same counts as you do:
;WITH Unpivoted AS (
SELECT RaceCode, Code, Value
FROM...
August 8, 2012 at 3:52 am
Nice work Lowell! I know I've learned a few tricks from some of your 10K posts!
I just hit 1,000 today. Gotta ways to go before they're redeemable.
August 7, 2012 at 7:45 pm
Viewing 15 posts - 3,076 through 3,090 (of 3,957 total)