November 12, 2006 at 5:33 pm
Hello,
I have a stored procedure that I just migrated to SQL 2005 from SQL 7. It
has worked in previous verions of SQL, but does not work now.
I have something like:
insert into TableA (Account,OutstandingLedger
select Account,OutstandingLedger=$0.0 from TableB
where ...
Account is varchar and OutstandingLedger is money. For some reason in SQL
2005, this puts NULL in OutstandingLedger in TableA, where in previous
version of SQL server it would put 0.00.
If I directly execute the following:
insert into TableA (Account,OutstandingLedger VALUES ('abc',$0.0)
then OutstandingLedger has the value of 0.00.
What am I missing here?
thanks in advance for any advise.
--mitch
November 13, 2006 at 6:27 am
insert into TableA (Account,OutstandingLedger
select Account,OutstandingLedger=$0.0 from TableB
don't do an assign operation in the select;
simply SELECT Account,0.00 from TableB
Lowell
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply