Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
tcarnahan
Starting Member
23 Posts |
Posted - 2011-02-22 : 13:04:18
|
I have SS2K but am using SSMS. I am attempting to programmatically capture scripts for all Indexes in a development database. My goal is to programmatically drop all indexes in the database (I have a script that interates all indexes), but I want to be able to easily recreate them as required. This is for a reporting database and the indexes are not keys.In SSMS, I have tried the following:- Selected the DB in the Object Explorer- Right Clicked and selected "Tasks\Generate Scripts"Unfortunately, it only allows you to script SPs, Tables, Users, and Views ... not indexes.Would anyone know how to script a DROP and CREATE for all indexes in a database?Where does SS store the script for Indexes? I have seen the script for SPs in syscomments. Is there an equivalent for Indexes?Thanks ahead of time for your advice! |
|
|
MIK_2008
Master Smack Fu Yak Hacker
1054 Posts |
Posted - 2011-02-22 : 13:15:43
|
| may be this is something you are looking for? DBCC DBREINDEX . it rebuilds the indexes for details you can read books online CheersMIK |
 |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
|
|
tcarnahan
Starting Member
23 Posts |
Posted - 2011-02-23 : 05:35:42
|
quote: Originally posted by MIK_2008 may be this is something you are looking for? DBCC DBREINDEX . it rebuilds the indexes for details you can read books online CheersMIK
This is a potential, but our DBA has all DBCC actions turned off. |
 |
|
|
tcarnahan
Starting Member
23 Posts |
|
|
|
|
|