views:

76

answers:

2

I'd like to be able to dump & load a MS-SQL database so I can recreate the storage locations, the original database was poorly configured with 1 storage location and I'd like to correct this issue.

My current attemtps at doing this have resulted in the identity columns being regenerated upon a load, this was while using the `Tasks > Import' facility that comes with "SQL Management Studio".

Restoring from a backup keeps recreating the original storage locations.

I'm new to MS-SQL so please forgive me if this is a basic topic, but I haven't been able to find a solution anywhere. I'm currently more familiar with Progress OpenEdge RDBMS.

+2  A: 

You're looking for SET IDENTITY_INSERT ON|OFF

Cruachan
Excellent, thankyou for this, this works a treat.
Brett Ryan
+1  A: 

You can use "bcp" from the command line to dump & load tables. The -E option on the command will retain identity values.

http://msdn.microsoft.com/en-us/library/aa337544.aspx

Trevor Tippins
Thanks for that, a little cumbersome in getting the dump and load working, though through a little scripting this proved effective.
Brett Ryan