System Tables Collision

  • Hi,

    Can anybody elaborate the difference Between

    1- Information_Schema.Columns

    2- Sys.Columns

    Tables in SQL Server 2005. I need to check the existance of a particular column or constraint over a column i a table. which one will you recommend and why.

    Regards

    Muhammad Asif

  • both are views of course, created to help pull information about the metadata together.

    the data in the two columns will often be the same; Information_Schema is a standard format...if you write a query against it, you should be able to copy and paste that query to query another database system.Oracle,MySQL, etc, but I've never done that yet to prove the concept.

    sys.columns is a view that microsoft put together that they believe offers information you might need, and often has information not found in information_schema.

    Microsoft has said that the column order in their sysviews will remain the same in future versions, and if they add more information, they will apend new columns to the end of the views.

    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!

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

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