Reindexing causing strange SQL to be run

  • I have a customer that is reindexing our database and the reindex job that is causing the following SQL to be seen:

    INSERT INTO [schema_a].[table_a] SELECT * FROM [schema_a].[table_a]

    schema_a is our schema name

    table_a is our table name

    the command being run is ALTER INDEX with no options except (online = on)

    I'm wondering if this is related to enterprise edition and how it handles online reindexing. I'm just looking for confirmation if anyone else out there has seen this.

    Thanks in advance for taking any time to read and assist if you do. Thanks, Even if you don't!

    --------------------------------------------------------------------------
    When you realize you've dug yourself into a hole....Step 1...stop digging.

  • That's how the index rebuild is executed behind the scenes

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • http://sqlblog.com/blogs/adam_machanic/archive/2011/04/10/commands-batches-and-the-mysteries-of-text-a-month-of-activity-monitoring-part-10-of-30.aspx

    Not only index rebuild...

    "

    Two other considerations for the [sql_text] column:

    ...

    Certain system features, such as automatic statistics updates, may cause surprising results to be returned in the [sql_text] column. For example, rebuilding an index will result in text along the lines of “insert [dbo].[yourTable] select * from [dbo].[yourTable].” If you see something like this, do not be alarmed! Take a deep breath and use the @get_outer_command option to find out what’s really going on.

    "

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply