| 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
|