List all tables and fields in database


/ Published in: SQL
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.