Skip to content

Instantly share code, notes, and snippets.

@dannylloyd
Last active December 15, 2015 00:09
Show Gist options
  • Select an option

  • Save dannylloyd/5170575 to your computer and use it in GitHub Desktop.

Select an option

Save dannylloyd/5170575 to your computer and use it in GitHub Desktop.
Gets column name, type, and nullable from table definition
DECLARE @tableName varchar(50);
SET @tableName = '';
SELECT
COLUMN_NAME,
DATA_TYPE,
IS_NULLABLE
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = @tableName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment