The following SQL command will display all the columns of certain type. This works on Microsoft SQL Server. It will display table name and column name. In this case, we are displaying all columns of type datetimeoffset.
More on datetimeoffset (link).
SELECT table_name [Table Name], column_name [Column Name]Source: link
FROM information_schema.columns where data_type = 'datetimeoffset'
More on datetimeoffset (link).
2 comments:
Note that will return columns from views as well, you need to join to information_schema.columns to filter them.
I find sp_help very useful when writing queries in SSMS, if you set up a keyboard shortcut all you have to do is select text and it will execute sp_help '[selected_text]'
Oops, I meant join to information_schema.tables
Post a Comment