Last active
April 12, 2016 07:29
-
-
Save vikaskanani/69702cb5405165c574ab to your computer and use it in GitHub Desktop.
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 | |
tbl.name 'Table Name', | |
c.name 'Column Name', | |
t.Name 'Data type', | |
c.max_length 'Max Length', | |
c.precision, | |
c.is_nullable, | |
ISNULL(i.is_primary_key, 0) 'Primary Key' | |
FROM sys.columns c | |
INNER JOIN sys.types t ON c.user_type_id = t.user_type_id | |
INNER JOIN sys.tables tbl on tbl.object_id = c.object_id | |
LEFT JOIN sys.index_columns ic ON ic.object_id = c.object_id AND ic.column_id = c.column_id | |
LEFT JOIN sys.indexes i ON ic.object_id = i.object_id AND ic.index_id = i.index_id | |
WHERE 1=1 | |
AND t.Name = 'numeric' | |
AND c.scale = 0 | |
--AND ( | |
-- c.name like '%bid%' | |
-- or | |
-- tbl.name like '%bid%' | |
--) | |
ORDER BY tbl.name |
Closed a day having 301
190
Yuhuuuuuuuuuuu. Only 1 table left.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yuuuuu. 500