Wednesday, March 21, 2012

Incorrect Scripts using database generate scripts wizard

I am getting incorrect scripts, not an error, on the indexes when I use the database ‘generate scripts’ wizard.This only happens when I have 8 or more tables and on indexes with include columns.It’s getting the index columns mix up the include columns.Here are the scripts I got:

-- From database ‘generate scripts’ wizard with 8 or more tables(Incorrect)--

CREATE UNIQUE NONCLUSTERED INDEX [IX_DimArmType_Lookup] ON [dbo].[DimArmType]

(

[EW_Arm_Type_Skey] ASC,

[Arm_Type_ID] ASC

)

INCLUDE ( [Arm_Type_LD],

[EW_Source_DB_ID]) WITH (PAD_INDEX= OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

The ‘script index as’ wizard seem to work fine.

--From ‘script index as’ wizard (Correct)--

CREATE UNIQUE NONCLUSTERED INDEX [IX_DimArmType_Lookup] ON [dbo].[DimArmType]

(

[EW_Source_DB_ID] ASC,

[Arm_Type_ID] ASC

)

INCLUDE ( [EW_Arm_Type_Skey],

[Arm_Type_LD]) WITH (PAD_INDEX= OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF) ON [PRIMARY]

This is happening on all SQL 2005 machines I tested, with or without SP1 and hotfixes.

This doesn't sound like an SSIS issue. You might want to try a more appropriate forum.|||This app uses SMO to script out all objects in any 2000 or 2005

database. The source is freely available so you can easily modify

it if it's not to your liking. It generates a separate file for each

object, which is useful for getting all your code into source control

if it isn't already.

http://www.elsasoft.org/tools.htm

No comments:

Post a Comment