Wednesday, August 22, 2012

How to check details for any cloumn in your Database?

Here is a query to check the columns filtered by Data Type and by Column Name in a particular Database -

SELECT Table_Catalog, Table_Schema, Table_Name, Column_Name,Data_Type, Character_Maximum_Length
FROM INFORMATION_SCHEMA.COLUMNS
WHERE Data_Type like '%DataType%' AND COLUMN_NAME like '%ColumnNameHere%'

No comments:

Post a Comment