Created
November 12, 2015 13:03
-
-
Save lanekatris/0d61b065f59e10f47a77 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
| declare @schemaName nvarchar(100) = 'item' | |
| declare @tableName nvarchar(100) = 'location' | |
| declare @dataType nvarchar(100) = 'decimal' | |
| select | |
| s.name, | |
| t.name, | |
| c.name, | |
| c.is_nullable, | |
| st.name | |
| from sys.columns c | |
| inner join sys.tables t | |
| on t.object_id = c.object_id | |
| and t.name = @tableName | |
| inner join sys.schemas s | |
| on s.schema_id = t.schema_id | |
| and s.name = @schemaName | |
| inner join sys.types st | |
| on st.system_type_id = c.system_type_id | |
| and st.name = @dataType |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment