Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Backup and restore a table
Message
 
General information
Forum:
Microsoft SQL Server
Category:
Backups
Miscellaneous
Thread ID:
01682994
Message ID:
01683010
Views:
29
>I do have a PK which is an Identity column. So, I suppose, after I rename the table, I can set the Identity again.
>I will have to test this concept.
>Thank you.

You can try:

1. In SSMS right click on the table and select 'Script as create'
2. In that script change names to use new names
3. SET IDENTITY INSERT OFF
4. insert into NewTable (list all columns)
select list All Columns from myTable

--- This is assuming you don't use some advanced features such as temporal table

Once you're ready to get back you would also need to use

DBCC CHECKIDENT ('MyTable', RESEED, MaxCurrentValue);

(https://stackoverflow.com/questions/21824478/reset-identity-seed-after-deleting-records-in-sql-server)
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform