Home > Archive > MS SQL Server > April 2006 > Dynamic Index Drop and Create









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Dynamic Index Drop and Create
stabbert

2006-04-07, 11:23 am

I am working on a data warehouse that is SQL Server 2000 based and what
I need to do is create two stored procs that do the following psuedo
code. I can write it myself but if someone has already written it then
why write it again or if you know of solutions that are close to what I
want that would be a good start. The reason that these need to be in
two seperate procs is that I want to seperate out the Drop and Creates
from the stored procedure that is loading the table. Instead of
hardcoding the drops and creates I want this procedure to be more
dynamic so that as we add indexes for tunning we don't have to maintain
our stored procedures.

proc_DropIndexes @DatabaseName, @TableName
- Write all necessary current index information to a work table for
@DatabaseName and @TableName to allow for recreation
- Drop all current indexes for @DatabaseName and @TableName

proc_CreateIndexes @DatabaseName, @TableName
- Read all necessary current index information from a work table for
@DatabaseName and @TableName to allow for recreation
- Create all indexes for @DatabaseName and @TableName

Thanks,
Spencer

stabbert

2006-04-07, 11:23 am

The following appear to be good starts...
http://www.code-magazine.com/articl...&printmode=true

http://groups.google.com/group/micr...526e19
13


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com