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 2008 Forums
 Transact-SQL (2008)
 Update Single Feild Across DB

Author  Topic 

Jakdb
Starting Member

11 Posts

Posted - 2011-02-14 : 13:47:00
Hi,

I got a senario like, i need to update the feildA's data with across DB. And this FeildA has FK on across the DB.

How to update this through script, please let me know.

regards
jak

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2011-02-14 : 13:50:00
If you include the database part of the table name, you can join them

FROM [database1].[owner].table1
INNER JOIN [database2].[owner].table2 ON <keys>

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page

Jakdb
Starting Member

11 Posts

Posted - 2011-02-14 : 13:59:29
Hi Jim,

Thanks for the Quick reply,

But my senario was diffrent, its tabe is in the same database.

Exactly,
SOme tables in DB has Feild STOREID, i need to replace this storeid with new store information(ID), and this store id was mapped in several tables,as FK's.

do i need to diable FK's before i update the tables individually?
Go to Top of Page
   

- Advertisement -