Need more info on the sys.* tables

  • I just saw Andy Warren's post today called Get the Name - Using OBJECT_NAME Function. I was fascinated with the sys.all_columns table (or whatever it is). I've seen similarly named tables before, but I don't understand, where are these things located? When I look at any of my user databases, I don't see table there named sys.all_columns, or anything else sys.*. What are these tables called? (I would assume they're system tables, but I could be wrong about that.) How many other tables are there that start with sys.*? And what's their purpose?

    Kindest Regards, Rod Connect with me on LinkedIn.

  • They're not tables. They're views. Use sp_help on one of them.

    They're stored in the hidden system resource database and any tables they reference are hidden system tables.

    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
  • they are easy to find, you just have to realize they are not real tables...they are Views...and they are also system views, so they are in a seperate folder in the object explorer:

    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!

  • Thank you Gail, Lowell and Steve!

    Kindest Regards, Rod Connect with me on LinkedIn.

Viewing 5 posts - 1 through 4 (of 4 total)

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