Forum Replies Created

Viewing post 1 (of 1 total)

  • RE: Indexdefrag for all tables in the database

    Create Procedure sp_IndexDefragAllDatabasesTables

    As

    EXECUTE sp_msforeachdb 'USE [?]

    DECLARE @TableName sysname

    DECLARE @indid int

    DECLARE cur_tblfetch CURSOR FOR

    SELECT table_name

    FROM information_schema.tables with (nolock)

    WHERE table_type = ''base table''

    OPEN cur_tblfetch

    FETCH NEXT FROM cur_tblfetch INTO @TableName

    WHILE @@FETCH_STATUS =...

Viewing post 1 (of 1 total)