Viewing 12 posts - 1 through 12 (of 12 total)
The part of the article I loved is where it was pionted out how many integers I'm wasting. My boss will kill me if I do it at work,...
December 10, 2007 at 10:27 am
D'oh!
Here I was all smug 😎 about: -1*sign(@a)*@a
when yours: (-1)*abs(@a)
is even more elegant. 🙂
October 19, 2007 at 1:56 pm
B.A. in Anthropology (with a heavy tilt toward Archaeology).
Though between 1995 (when I was kicked out of university) and 2003 (when I finally graduated from that same university) is when...
October 19, 2007 at 11:07 am
Here's another way to always endup with a negative number (this works whether you start with a positive or a negative number):
DECLARE @a INT
SET @a =...
October 18, 2007 at 8:49 am
I was wondering the usefulness myself. Unless you store elsewhere data to put back in the decimal, I can't imagine the number being very useful. But I'm sure...
October 11, 2007 at 8:10 am
Fixed for 12345.0
Declare @original decimal(25,10)
Set @original = 12345.0 -- 09876504321.120345678
IF (@Original-(cast(@Original as bigint))) = 0
select cast(@Original as bigint)
ELSE
select cast(@Original*power(10,len(cast(Reverse(cast(@Original-(cast(@Original as bigint)) as decimal(25,14))) as decimal(25,0)))) as...
October 8, 2007 at 8:57 am
And for those of you who, unlike me, remember that you can use bigint if int is too restrictive, this works as well as my last post, and doesn't have...
October 5, 2007 at 1:18 pm
Well, it's not quite ideal as I can't use numbers with 10 decimal places. My method is restricted to 9 digits after the decimal place, but that isn't too...
October 5, 2007 at 12:54 pm
OK. I've gotten around my the problem with my earlier submission where I was restricted to 9 digits to the left of the decimal, and 6 digits to the...
October 3, 2007 at 4:02 pm
Thanks to SQLServerCentral.com I can lie, cheat, and steal.
I lie around the site, soaking up information by reading articles, scripts, challenges, etc.
I cheat the future by reading about issues others...
October 2, 2007 at 12:59 pm
Now keep in mind, I'm still kind of a newbie, but this seems to work ok. Though it gacks if you use more than 9 digits before or more...
October 1, 2007 at 3:07 pm
The other side of this coin is the interviewer who doesn't have the decency to let you know you've been passed. This has only happened to me once, but...
July 30, 2007 at 12:55 pm
Viewing 12 posts - 1 through 12 (of 12 total)