January 17, 2012 at 4:27 am
In my table i have a column 'DescriptionID' which is a Guid (NOT NULL)
Ive created an index on this column in enterprise manager (non unique) and saved the table
When I generate a create script for this table, the index isnt defined anywhere
am I missing something ?
January 17, 2012 at 4:29 am
No, just that the tools don't usually script indexes when you ask for the table to be scripted. It can be a separate option, depending how you did the script.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
January 17, 2012 at 4:36 am
ah, ok, so Id have to script the entire database and select the 'include index' option. Seems a bit odd that I cant script indexes on individual tables
January 17, 2012 at 4:42 am
You certainly can script individual indexes. From Object Explorer expand out the table, right click on the index (under the table -> indexes) and select script.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
January 17, 2012 at 4:52 am
There is also an option in Tools->Options->SQL Server Object Explorer->Scripting->Table and view options->Script indexes
Set the value to "True" and then try scripting the table, you should get the script of the indexes
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply