sql - Re-indexing script -


can tell me if re-indexing script looks correct? included portion of it. if not, there better way of doing it.

-- ********************************************************************** -- index idxaddedresource_main on table addedresource -- ********************************************************************** if exists(select 1             sysindexes si             inner join sysobjects                    on so.id = si.id            si.[name] = n'idxaddedresource_main' -- index name              , so.[name] = n'addedresource')  -- table name begin     drop index [idxaddedresource_main] on [dbo].[addedresource] end go create clustered index [idxaddedresource_main] on [dbo].[addedresource] (     [addedresourcecode] asc )  (fillfactor = 90) on [primary] go  -- ********************************************************************** -- index addedresource_addedresourcecode on table addedresource -- ********************************************************************** if exists(select 1             sysindexes si             inner join sysobjects                    on so.id = si.id            si.[name] = n'addedresource_addedresourcecode' -- index name              , so.[name] = n'addedresource')  -- table name begin     drop index [addedresource_addedresourcecode] on [dbo].[addedresource] end go create index [addedresource_addedresourcecode] on [dbo].[addedresource] (     [addedresourcecode] asc )  (fillfactor = 90) on [primary] go 


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -