Viewing 15 posts - 58,531 through 58,545 (of 59,099 total)
Pat,
Basically, any legal expression may be used so long as it does not refer to another table. Cast and Case may be used. SELECT may not because it's a "clause"...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 30, 2005 at 1:02 pm
Nope... it's not... SET ls_action=0 will fail in the absence of other code. You either have to declare ls_action as variable (don't forget to add the @ sign) or you have...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 30, 2005 at 12:37 pm
Daniel,
The other thing you may not be aware of is that if you update ANY column in the table that has a timestamp column, the TimeStamp will change. I think...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 30, 2005 at 12:27 pm
Ok, thanks... you sure you wanted the duplication in the #QueryTable? Could get pretty nasty if you have lots of rows...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 30, 2005 at 12:05 pm
Steve and Ken...
Yup, I knew that... I just thought that since Trigger recommended it as a T_SQL command, there might be some neat trick he was using to use it...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 30, 2005 at 12:02 pm
Yup, your method works just fine (but what a pain with all of those indexes). And, deleting the "dupes" probably wouldn't be any faster because of the indexes.
And, to answer...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 29, 2005 at 10:30 pm
Trigger,
How do you use BCP from T-SQL without using xp_CmdShell which is normally off limits to all but those members of the SA role?
--Jeff Moden
Change is inevitable... Change for the better is not.
December 29, 2005 at 10:15 pm
Thgamble1,
Carl has the correct answer here... did it work for you or do you still have a question?
--Jeff Moden
Change is inevitable... Change for the better is not.
December 29, 2005 at 10:07 pm
It would be real nice if you posted the function that work's so great... thanks.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 29, 2005 at 11:15 am
Andrew, you're making a classic error... you are doing traditional rounding to 3 places before you are attempting the bankers rounding....
Just like the example of 3.445657545 being rounded to 3.45...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 29, 2005 at 7:04 am
Carl wrote: "For 3.455, since the third decimal position value is 5 and the second decimal position is odd, this should truncate, not round. The expected results should be 3.45...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 29, 2005 at 6:35 am
BWAAA-HAAAA-HAAAA-HAAA! Snooorrtt! OOOOOOOHHHHH-WEEEEEE! UNBELIEVABLE!!!! WE DON' NEED NO STINKIN' LOOPS... WE DON' NEED NO STINKIN' UDF. WE DON' NEED NO STINKIN' CALCULATIONS!!!! SQL SERVER HAS A FUNCTION TO DO BANKERS...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 28, 2005 at 8:57 pm
As a DOS command, you can use OSQL -L
You could route that to a file using OSQL -L > somefilename
--Jeff Moden
Change is inevitable... Change for the better is not.
December 28, 2005 at 8:11 pm
AND, dont' feel too alone on that MONEY v.s. DECIMAL thing... I just changed to the DECIMAL data type on my attempted code and ALL the answers became 3.45 --Jeff Moden Change is inevitable... Change for the better is not.
RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.
Helpful Links:
How to post code problems
How to Post Performance Problems
Create a Tally Function (fnTally)
December 28, 2005 at 9:45 am
Ryan,
Your code works great so long as the MONEY data type is used to hold the number and is probably appropriate for the Banker's Rounding problem because one must assume...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 28, 2005 at 9:37 am
Viewing 15 posts - 58,531 through 58,545 (of 59,099 total)