Query tables and columns of a database

select sysobjects.name as tablename,
 syscolumns.name as columnname,
 systypes.name as datatype,
 syscolumns.length as length
 From sysobjects Inner Join syscolumns
 ON Sysobjects.id=syscolumns.id
 inner join systypes systypes
 ON systypes.xtype=syscolumns.xtype
 Where sysobjects.type='U'
 Order by tablename
System Tables

Related Posts

No Comments Yet.

Leave a reply

You must be logged in to post a comment.