Created
January 17, 2014 01:51
-
-
Save 284km/8467151 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 column_name AS [Name], | |
IS_NULLABLE AS [Null?], | |
DATA_TYPE + '(' + CASE | |
WHEN Cast(CHARACTER_MAXIMUM_LENGTH AS VARCHAR(5)) = -1 THEN 'Max' | |
ELSE Cast(CHARACTER_MAXIMUM_LENGTH AS VARCHAR(5)) | |
END + ')' AS [Type] | |
FROM INFORMATION_SCHEMA.Columns | |
WHERE table_name = 'table_name_here' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
exec sp_columns 'table_name'
こっちのがよさそうか