Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

scripting indexes

Status
Not open for further replies.

katgirl

Programmer
Jul 6, 2006
114
US
Hi,

I have about 20 tables that I need to script indexes.

That is, for each table, I'd like to have DROP and CREATE statements for all the indexes on the table, including primary keys.

Does anyone have a script that can do this quickly and painlessly?

THANKS much
 
try this on one table:

1. right click on the table
2. choose "All Tasks", "Generate SQL Scripts"
3. Go to "Formatting" tab. Uncheck ALL the options.
4. Go to "Options" tab. In "Table scription options" choose "Script Triggers".

if that works then you can do the same using bulk scripting...

Known is handfull, Unknown is worldfull
 
i think doing one by one is too painful... i need a script to do all at once... i was hoping someone had a script already written that i could use using system tables to generate

i could write my own, but it would take longer
 
>>i think doing one by one is too painful... i need a script to do all at once

not required, you can select multiple objects for scripting at one shot...

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top