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

paypal - How to know the URL referrer in PHP? -

oauth - Facebook OAuth2 Logout does not remove fb_ cookie -

wpf - Line breaks and indenting for the XAML of a saved FlowDocument? -