index columns datatype

  • Anyone has TSQL to findout index columns and those columns datatype?

    I tried SELECT * FROM SYS.INDEXES but it has no info of that.

  • same datatype as the column it's on....there's rare exceptions where you make an index on a persisted calculated column that is the substring of a column, so then it's the length of the substring.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Query sys.indexes, sys.index_columns and sys.columns. You'll also need a join to sys.types.

    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

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

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