Posted By

lance on 08/05/10


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Tyster


List all tables and fields in database


 / Published in: SQL
 

  1. --list all tables and fields in a database
  2. SELECT sysobjects.name AS TableName, syscolumns.name AS FieldName,
  3. syscolumns.colorder AS FldOrder
  4. FROM sysobjects INNER JOIN syscolumns ON syscolumns.id = sysobjects.id
  5. WHERE sysobjects.type = 'U'
  6. ORDER BY sysobjects.name, syscolumns.colorder

Report this snippet  

You need to login to post a comment.