Viewing 15 posts - 35,266 through 35,280 (of 59,102 total)
Considering many local taxes based on address and the like not to mention constantly changing tax laws, my suggestion would be to not do it in SQL Server. Use...
--Jeff Moden
Change is inevitable... Change for the better is not.
January 23, 2011 at 9:59 pm
OMG! How did the old cartoon series used to say it? "Ahhhh, Magoo... You've done it again!". Well done. NOW I can go to bed! ...
--Jeff Moden
Change is inevitable... Change for the better is not.
January 23, 2011 at 9:34 pm
Ugly is OK... especially if Ugly works fast. I'll give it a try.
--Jeff Moden
Change is inevitable... Change for the better is not.
January 23, 2011 at 9:22 pm
mister.magoo (1/23/2011)
Hope you can work around this because mine is way too slooooowww! and ugly!
Glad to hear that my code isn't the only slow and ugly one on this problem....
--Jeff Moden
Change is inevitable... Change for the better is not.
January 23, 2011 at 5:45 pm
Darned good try, Peter. But it doesn't hold up for other data ({edit} Magoo beat me to it while I was writing this post). I know... it's a...
--Jeff Moden
Change is inevitable... Change for the better is not.
January 23, 2011 at 5:40 pm
SwePeso (1/23/2011)
--===== Peso's code
;WITH cteSource(ID, SequenceID)
AS (
SELECTu.ID,
ROW_NUMBER() OVER (PARTITION BY u.theValue ORDER BY u.ID) AS SequenceID
FROMdbo.Mvts AS s
UNPIVOT(
theValue
FOR theCol IN (s.idMvt1, s.idMvt2, s.idMvt3)
) AS...
--Jeff Moden
Change is inevitable... Change for the better is not.
January 23, 2011 at 2:56 pm
Depending on what you're really doing, the may be no need here for a separate stored procedure nor even a UDF...
SELECT t1.ReqID,
...
--Jeff Moden
Change is inevitable... Change for the better is not.
January 23, 2011 at 2:45 pm
Gah! Sorry CC... although your code works with the original data, it doesn't work when we insert a new row. Try yours with the following data...
DROP TABLE MVTS
...
--Jeff Moden
Change is inevitable... Change for the better is not.
January 23, 2011 at 10:14 am
ColdCoffee (1/22/2011)
--Jeff Moden
Change is inevitable... Change for the better is not.
January 23, 2011 at 9:55 am
mister.magoo (1/22/2011)
I offer this
First just the solution (which assumes you have added an "ID" column)
SELECT *
FROM...
--Jeff Moden
Change is inevitable... Change for the better is not.
January 23, 2011 at 9:48 am
Steve Jones - SSC Editor (1/22/2011)
Definitely not SQL related, but my kid got his black belt today. Very proud of him.
Very cool. Congrats to both of you.
--Jeff Moden
Change is inevitable... Change for the better is not.
January 23, 2011 at 9:32 am
kenambrose (1/22/2011)
Actually, no, not at all. The first thing I do...
--Jeff Moden
Change is inevitable... Change for the better is not.
January 23, 2011 at 9:13 am
To everyone,
Thank you for the wonderful discussion and all the code folks posted. Because I've not actually had to work on code that needs to be sensitive to language...
--Jeff Moden
Change is inevitable... Change for the better is not.
January 23, 2011 at 9:04 am
sql_butterfly (1/22/2011)
1. Is this the right way to check some condition:
...
--Jeff Moden
Change is inevitable... Change for the better is not.
January 22, 2011 at 8:04 pm
Steve Jones - SSC Editor (1/20/2011)
Abstract: Learn practical ways in this session that you can use to build your career...
--Jeff Moden
Change is inevitable... Change for the better is not.
January 22, 2011 at 7:28 pm
Viewing 15 posts - 35,266 through 35,280 (of 59,102 total)