sql - Put back deleted row from another db while preserving id field -


I have a SQL 2005 database.

I have removed the row from one of them and want to get it back from another database which was a backup of the line.

How does this ID target while preserving its ID primary key field?

Can you give a TSQL to do this, is there a backup called "TbrPdata" and "TBR0910"?

Malcolm

Use:

  SET IDENTITY_INSERT tbrPdata.dbo.TABLE in tbrPdata.dbo.TABLE (col1, col2, col3, ...), select t.col1, t.col2, t Col3, ... to tbr0910.dbo.TABLE T WHERE T.id =? Go SET IDENTITY_INSERT tbrPdata.dbo.TABLE OFF  

Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -