sys.columns X syscolumns

  • Hi everybody,

    I will create an application to list the columns of my database, what the difference between sys.columns and syscolumns ?

    They are not tables? which tables these views access ?

    Thanks,

    Jose A. Carvalho Jr

  • JoseACJr (7/12/2012)


    Hi everybody,

    I will create an application to list the columns of my database, what the difference between sys.columns and syscolumns ?

    They are not tables? which tables these views access ?

    Thanks,

    Jose A. Carvalho Jr

    both are views.

    syscolumns is a view that is deprecated and will be dropped in an upcoming version of SQL; it was left in place for compatibility when SQL 2005 was introduced. In versions 2000 and prior, it was the actual meta data of the columns,a nd you could potentially directly edit that data; in 2005 it became a true view, and the ability to directly manipulate the meta data was removed (from those types of compatibility views)

    sys.columns is a view that MS plans on maintaining; they may add more columns to the end int eh future, but the columns and order of what exists now should stay the same.

    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!

  • You could also use the ANSI standard INFORMATION_SCHEMA.COLUMNS view. I have used that in an application that had to work with SQL Server, SYBASE, DB2.

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

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