Re: How Do You Get The Description Property?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Aaron [SQL Server MVP] (ten.xoc_at_dnartreb.noraa)
Date: 08/06/04


Date: Fri, 6 Aug 2004 09:59:01 -0400

I'm going to update both #2244 and http://www.aspfaq.com/2177 with this
information shortly.

Note that you should avoid using sysobjects, syscolumns, systypes etc.
directly. These tables aren't always going to exist...

-- 
http://www.aspfaq.com/
(Reverse address to reply.)
"John Smith" <js@no.com> wrote in message
news:#XMUBx7eEHA.704@TK2MSFTNGP09.phx.gbl...
> Very cool.  Thanks.  But, how do I tell it to return it for all tables?
> Seems you have to specify the table name:
>
> SELECT name, value FROM ::fn_listextendedproperty
> (null, 'user', 'dbo', 'table', 'tableName', 'column', null)
>
> I've tried replacing tableName with default, null, '*', '%%', '%'...but
all
> those don't return any values at all.
>
> Or even better, I plan to add this to another sql statement which uses
> sysobjects, syscolumns, and systypes.  How can I join it so it looks at
the
> current table that the sql statement is on?  I tried replacing tableName
> with sysobjects.name (when inside the other query) but that returns a
syntax
> error.  Example:
>
> SELECT *
> FROM syscolumns INNER JOIN sysobjects ON syscolumns.id = sysobjects.id
INNER
> JOIN systypes ON syscolumns.xtype = systypes.xtype
> LEFT OUTER JOIN ::fn_listextendedproperty
> (NULL, 'user', 'dbo', 'table', 'tableName', 'column', default) p
> ON p.objName = syscolumns.name
> WHERE (sysobjects.xtype = 'U')
>
> Thanks!
>
>
>
> "John Smith" <js@no.com> wrote in message
> news:#G2hYI7eEHA.712@TK2MSFTNGP09.phx.gbl...
> > Hey folks,
> >
> > You know that Description field that every column has in Enterprise
> Manager?
> > Well, how do you get access to it's value through SQL?
> >
> > I've been looking like mad through all the sys tables and it doesn't
> appear
> > to be in them...though I could have missed it.
> >
> > Anyone know where it's stored and/or how to get it through a SQL
> statement?
> >
> > Thanks!
> >
> >
>
>


Relevant Pages

  • Re: MSforeachdb question
    ... You can execute the script directly with a USE statemement rather than ... > c.xprec as prec, c.xscale as scale from syscolumns c, ... > sysobjects o, systypes t where o.id =c.id ...
    (microsoft.public.sqlserver.server)
  • system tables in MS SQL server 5
    ... I am using MS SQL Server management studio. ... I treid to see some system tables which are sysobjects, syscolumns, ... systypes, etc.., but i don't see the list under the system tables ...
    (comp.databases.ms-sqlserver)
  • Re: add column if it does not exist
    ... FROM sysobjects, ... ALTER TABLE Person ... Your solution would be to use dynamic SQL for the DDL. ...
    (comp.databases.sybase)
  • Re: add column if it does not exist
    ... FROM sysobjects, ... ALTER TABLE Person ... Your solution would be to use dynamic SQL for the DDL. ...
    (comp.databases.sybase)
  • Re: add column if it does not exist
    ... column already exists in the database I am testing this in. ... FROM sysobjects, ... ALTER TABLE Person ...
    (comp.databases.sybase)