Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
skybvi
Posting Yak Master
193 Posts |
Posted - 2011-04-05 : 16:30:45
|
Hi, I am running this code:-DECLARE @tab TABLE( upc NVARCHAR(20), ITEMNMBR NVARCHAR(20), DESCRIPTION NVARCHAR(200), QTY_SOLD FLOAT, SALES_AMOUNT FLOAT, PRIMVNDR CHAR(15), VENDOR_NAME CHAR(65))INSERT @tab( upc, ITEMNMBR, DESCRIPTION, QTY_SOLD, SALES_AMOUNT, PRIMVNDR, VENDOR_NAME )SELECT *FROM ff_2UPDATE @tab SET t.itemnmbr=a.itemnmbr FROM @tab t join EP40101 a on a.itemupccode = t.upcUPDATE @tab SET itemnmbr = case when (itemnmbr <> b.itemnmbr) itemnmbr = 'NULL' ELSE itemnmbr end from @tab t join dbo.IV00101 b on t.itemnmbr= b.itemnmbrselect * from @tab--AND IAM GETTING THIS ERROR:-Msg 102, Level 15, State 1, Line 39Incorrect syntax near 'itemnmbr'.Regards,SushantDBAWest Indies |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
skybvi
Posting Yak Master
193 Posts |
Posted - 2011-04-06 : 09:44:08
|
yes, the syntax error went but i didnt get the result as I wanted.I thought it would replace the column value of that itemnmbr as NULL, but its the same :(Regards,SushantDBAWest Indies |
 |
|
|
|
|
|
|