September 28, 2012 at 8:56 am
I have a stored procedure that builds 'alter index rebuild .... ' statements with the online option if that is viable that is designed to run as a maintenance job. There are other variables in play such as fragmentation and number of rows in the table that determine whether or not the index gets rebuilt.
With regards to the offline index rebuilds, we need to hit a specific maintenance window in a 24/7 environment. Right now, the proc just executes the statement via
execute (@SQLStatment). Since the time needed to build the statments varies from day to day, it is proving difficult to hit the given window.
So what I would like to do is send the @SQLStatment string to a Offline_index_maintenance.sql file that I could then call during the specified time.
Thoughts? is there a better way to do this?
Thanks for your time,
Ken
September 28, 2012 at 9:10 am
why to a text file, and not a table in say, the msdb database, which can contain a suite of commands for you to run during you rmaintenance window?
why must it be a file vs a row in a table?
Lowell
September 28, 2012 at 9:14 am
It doesn't have to be, and now that you've said that I'm going to go kick myself for getting tunnel vision on a user request.
Thanks!
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply