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
 Transact-SQL (2000)
 Copy column from one database to another?

Author  Topic 

FruitBatInShades
Yak Posting Veteran

51 Posts

Posted - 2007-04-23 : 05:44:10
I need to copy a field from one table in 1 database to another

UPDATE    Pages
SET Content = db1.dbo.PageContent.Content
WHERE (UniqueID = db1.dbo.PageContent.UniqueID)


SQL Server errors saying that the column prefix 'db1.dbo.PageContent' does not match a table or column used within the query.

How do I copy this feield from one db1.table1 to db2.Table2?

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-04-23 : 05:47:12
[code]
update t2
set content = t1.content
from db1.dbo.table1 t1 inner join db2.dbo.table2 t2
on t1.uniqueid = t2.uniqueid
[/code]


KH

Go to Top of Page
   

- Advertisement -