Skip to content

Instantly share code, notes, and snippets.

@sinairv
Created July 26, 2012 01:41
Show Gist options
  • Save sinairv/3179773 to your computer and use it in GitHub Desktop.
Save sinairv/3179773 to your computer and use it in GitHub Desktop.
Finding all columns of type uniqueidentifier in all tables
SELECT C.TABLE_NAME, C.COLUMN_NAME FROM
INFORMATION_SCHEMA.COLUMNS C
INNER JOIN INFORMATION_SCHEMA.TABLES T ON C.TABLE_NAME = T.TABLE_NAME AND T.TABLE_TYPE = 'BASE TABLE'
WHERE C.DATA_TYPE = 'uniqueidentifier'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment