SqlDbx Forum

SqlDbx

You are not logged in.

#1 2013-03-13 09:48:08

gmiller
Member

IDENTITY columns not scripting

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

#2 2013-03-13 18:56:38

sqldbxhelp
Administrator

Re: IDENTITY columns not scripting

This is by design. Not sure why would you want identity column included.

Offline

#3 2013-03-14 08:24:22

gmiller
Member

Re: IDENTITY columns not scripting

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

#4 2013-03-14 16:54:31

sqldbxhelp
Administrator

Re: IDENTITY columns not scripting

I see your point. Can be an option

Offline

Board footer

Powered by FluxBB