Viewing 15 posts - 61 through 75 (of 87 total)
@@SPID seems to work just fine. I've appended the @@spid value to the ##temp table name for each user. I plan to drop the tables after using them...
April 23, 2003 at 9:41 am
Unfortunately, I can't use global temp tables because there could be many instances running at the same time, via VB and ASP. (I should have mentioned that in my...
April 23, 2003 at 9:25 am
Another oddity. How you view the results affects the test.
Try using PRINT vs SELECT to view the output when casting as FLOAT:
Declare @val Decimal(18,10)
January 3, 2003 at 12:43 pm
Thanks for the reply Paul. I'll look into the table variable as soon as we upgrade to sql 2000...Right now we're on SQL 7 though, so I think I'm...
January 3, 2003 at 12:23 pm
FLOAT also gets ugly, both in output and in accuracy, with really small numbers:
Declare @t as Decimal (18,12)
set @t = .0000000009
SELECT cast (@t as float)
Result:
-----------------------------------------------------
8.9999999999999999E-10
(1 row(s) affected)
Also as Antares...
January 3, 2003 at 10:44 am
Thanks again to all of you. I was leaning toward explicit declaration anyway, but with this strong, unanimous endorsement I'll do it for sure. I always harp on...
January 2, 2003 at 3:32 pm
Thanks again Antares, and Thanks David.
I combined these two ideas to get:
SELECT
REPLACE(RTRIM(REPLACE(REPLACE(RTRIM(REPLACE(ADJ_VALUE,'0',' ')),' ','0'),'.',' ')),' ','.') As Adj_Val
This single line of code does exactly what I want! The first...
January 2, 2003 at 8:14 am
One other thing,
I added an extra character to the Varchars for the decimal (.). I changed all Varchar(18) to Varchar(19).
December 31, 2002 at 4:31 pm
Thanks Greg,
After looking at Antares' example I had begun to play with REVERSE. That's it. I made one tweak to yours though. Since there are 10 digits,...
December 31, 2002 at 4:20 pm
Thanks Scorpion 66.
It's good to get validation that I'm barking up the right tree here. I sure did try to get it to work with WHILE, but...
December 31, 2002 at 2:16 pm
An off-topic side note. I tried using the code /code identifiers when pasting my code. Everything looks nicer in the web page but it doesn't cut and paste...
December 31, 2002 at 1:53 pm
OK, here's what I did. I had trouble using WHILE inside the select query...used CASE instead) I know that there are up to 10 0s past the decimal...
December 31, 2002 at 1:32 pm
Much of the data is quite small in value, so that wouldn't work for me. the .0016500000 would become 0.0. I need to keep all of the non-zero...
December 31, 2002 at 12:25 pm
Thanks, Jorg, for that tip. The sql looks more maintainable than the sub-join method to me. How do you find it does performance wise compared to the self-join...
December 16, 2002 at 8:27 am
Ok, to make things more complicated, the following code creates the 'grades' table. I've modified the original data and added a comment column. What I'd like to get...
December 13, 2002 at 9:25 am
Viewing 15 posts - 61 through 75 (of 87 total)