SqlDbx
You are not logged in.
Pages: 1
SQL Server 2008R2
When selecting an entire row from the results pane and selecting Generate | Insert, the insert is generated correctly, except the identity column is not scripted.
Similar behavior occurs trying to script using Export | File (as Inserts)
Is there a setting I need to change to enable identity columns to be scripted?
Offline
This is by design. Not sure why would you want identity column included.
Offline
One use case is: Customer deleted many rows from a table, then decided it would have been better if they weren't deleted. I am scripting inserts from a backup to restore the deleted rows. For various reasons, it's desirable to restore the same identity values.
Having identity columns not included seems a reasonable default, but I think it would be useful to have a Scripting/Log option called 'Script IDENTITY Columns'
I was able to get this done using Management Studio and a free extension called SSMS Tools Pack.
Offline
I see your point. Can be an option
Offline
Pages: 1