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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 #temp table

Author  Topic 

lane0618
Posting Yak Master

134 Posts

Posted - 2002-06-21 : 15:07:30
Is it possible to get this to work? I tried to do it with CSV but the list is too big for varchar(8000). I get this error:

Server: Msg 1032, Level 15, State 1, Line 7
Cannot use the column prefix '#temp'. This must match the object in the UPDATE clause 'dbo.Features_bu'.


select sku
into #temp
from dbo.data


UPDATE dbo.Features_bu
SET #temp.sku = 0
WHERE (dev IS NULL)

drop table #temp

Thanks!
Lane

jrlrwilson
Starting Member

3 Posts

Posted - 2002-06-21 : 15:11:04
you may need to create the #table prior to inserting into it.

jeremy wilson
Go to Top of Page

setbasedisthetruepath
Used SQL Salesman

992 Posts

Posted - 2002-06-21 : 15:12:16
quote:

Is it possible to get this to work? I tried to do it with CSV but the list is too big for varchar(8000). I get this error:

Server: Msg 1032, Level 15, State 1, Line 7
Cannot use the column prefix '#temp'. This must match the object in the UPDATE clause 'dbo.Features_bu'.


select sku
into #temp
from dbo.data


UPDATE dbo.Features_bu
SET #temp.sku = 0
WHERE (dev IS NULL)

drop table #temp

Thanks!
Lane



I'm inferring from your SQL that your intent is to set the SKU in dbo.data to zero where a corresponding row in dbo.features_bu has a NULL dev column. You will need a join in your update to do this. What is the foreign key relationship between dbo.data and dbo.features_bu?

Jonathan Boott, MCDBA
Go to Top of Page

lane0618
Posting Yak Master

134 Posts

Posted - 2002-06-21 : 16:31:52
The records that #temp.sku returns are column names. I don't know if I made that clear. So how do I pass the values in #temp.sku to my update statement?

Thanks,
LAne

Go to Top of Page
   

- Advertisement -