SORT_IN_TEMPDB index option

  • Can anyone tell me where SQL Server stores this option?

    I have looked in sysindexes, sys.indexes and also used indexproperty() and indexkey_property() and have found every other index option EXCEPT sort_in_tempdb.

    Where the heck is it?????

  • Sorry, but according to BOL (Books Online) that information is not stored in metadata.

  • Lynn Pettis (6/22/2009)


    Sorry, but according to BOL (Books Online) that information is not stored in metadata.

    Yeah, I saw that in BOL also. But it HAS to be stored somewhere. How else does it know when you right click on an index and select "Script Index as" and then "Create to" if SORT_IN_TEMPDB is ON or OFF?

    This has to be stored somewhere, right?

  • rob.patterson (6/22/2009)


    Lynn Pettis (6/22/2009)


    Sorry, but according to BOL (Books Online) that information is not stored in metadata.

    Yeah, I saw that in BOL also. But it HAS to be stored somewhere. How else does it know when you right click on an index and select "Script Index as" and then "Create to" if SORT_IN_TEMPDB is ON or OFF?

    This has to be stored somewhere, right?

    No. From BOL:

    The SORT_IN_TEMPDB option affects only the current statement. No metadata records that the index was or was not sorted in tempdb. For example, if you create a nonclustered index using the SORT_IN_TEMPDB option, and at a later time create a clustered index without specifying the option, the Database Engine does not use the option when it re-creates the nonclustered index.

  • okay, I get it. thanks for your help.:-)

  • Pretty poor that this value ISN'T stored and reused if you ask me - or even if you don't!! 😛

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • HI ,

    Go to C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\mssqlsystemresource..

    open it on notepad and search your index name over here.

    Regards

    Ashish Gupta

  • Hi ashish

    thanks for the reply.

    I only found 1 mdf and 1 ldf of the same name. I attached it but i didnt find anything useful in it.

  • @Ashish

    Go to C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\mssqlsystemresource..

    open it on notepad and search your index name over here.

    We cannot open the database File ( data or log) in a notepad or any text editor. IT can be read only by database engine.

  • chetanr.jain (8/24/2010)


    @Ashish

    Go to C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\mssqlsystemresource..

    open it on notepad and search your index name over here.

    We cannot open the database File ( data or log) in a notepad or any text editor. IT can be read only by database engine.

    Not that I am saying you SHOULD do this, but if you turn off the sql server process you can open this file with a hex file reader.

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

Viewing 10 posts - 1 through 9 (of 9 total)

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