Last active
August 29, 2015 14:01
-
-
Save nagasato/05b487086541d427c137 to your computer and use it in GitHub Desktop.
listing tables and columns (MS SQL Server)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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