Sqlserver
 sql >> Database >  >> RDS >> Sqlserver

UPDATE record in un database con valori di un altro in SQL Server 2008?

BEGIN TRANSACTION

UPDATE t1
SET    Description = t2.Description
FROM   db1.dbo.foo t1
       JOIN db2.dbo.foo t2
         ON t1.ItemID = t2.ItemID

SELECT * FROM db1.dbo.foo
--prevents changes from being committed
ROLLBACK