Skip to content

Instantly share code, notes, and snippets.

@nagasato
Last active August 29, 2015 14:01
Show Gist options
  • Save nagasato/05b487086541d427c137 to your computer and use it in GitHub Desktop.
Save nagasato/05b487086541d427c137 to your computer and use it in GitHub Desktop.
listing tables and columns (MS SQL Server)
SELECT objs.name TABLE_NAME, cols.name COLUMN_NAME, cols.is_identity, cols.is_computed FROM Sys.Columns cols
INNER JOIN Sys.objects objs ON (cols.object_id = objs.object_id)
WHERE objs.type = 'U'
ORDER BY objs.name ASC, cols.column_id ASC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment