Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

ID Column Problem

$
0
0

I need to have a unique non-null column in my table. I have set up an identity column with auto-increment and that works fine with one exception.

I often make mistakes when updating or inserting new records so I make a backup copy of my table before running the statments (select * into backup from table). When I need to restore from the backup I truncate the original table and then do a select into from the backup table. The problem is that this changes the identity column. I need the identity column to be the same after I restore the backup.

How can I do this?

Thanks,
Scott


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>