June 27, 2006 at 12:21 pm
I want to get a complete copy (with indexes) of a very large table to a new temp table in the fastest manner possible.
I can use the "select ....into " commands to create the basic table with the data, but without the indexes, and I want to create the indexes after the temp table is created.
How can I get a copy of the sql code (using TSQL) used to build the indexes of the initial table so that I can use it to build the indexes on the temp table?
using SQL Server 2000
Thanks for any and all help.
June 27, 2006 at 12:38 pm
Open Query Analyzer with your database open click on the index in the object browser and click on create and you will generate the create index statement you need. Hope this helps.
Kind regards,
Gift Peddie
Kind regards,
Gift Peddie
June 27, 2006 at 12:50 pm
I am aware of that method of getting the code to build the indexes.
I need a way within TSQL to get the indexes.
to rephrase: what sql code would I run to get the code to build the indexes?
Thanks again.
June 28, 2006 at 3:21 pm
Hello,
Have a look at the following sproc: master.dbo.sp_helpindex
The code in that sproc should point you in the right direction as to what you need to do to get at the index metadata.
Good Luck!
jg
June 28, 2006 at 4:27 pm
Perfect! With that stored procedure I should be able to accomplish what I want. Thanks for pointing me in the right direction.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply