Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
List all columns and other relevant data in a table. Found online http://weblogs.sqlteam.com/joew/archive/2008/04/27/60574.aspx
SELECT
ORDINAL_POSITION
,COLUMN_NAME
,DATA_TYPE
,CHARACTER_MAXIMUM_LENGTH
,IS_NULLABLE
,COLUMN_DEFAULT
FROM
INFORMATION_SCHEMA.COLUMNS
WHERE
TABLE_NAME = 'TableName'
ORDER BY
ORDINAL_POSITION ASC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment