Useful script
USE SmartHire
GO
SELECT TABLE_NAME, COLUMN_NAME,
COLUMNPROPERTY(OBJECT_ID(TABLE_SCHEMA + '.' + TABLE_NAME), COLUMN_NAME, 'ColumnID') AS COLUMN_ID,
DATA_TYPE
FROM SmartHire.INFORMATION_SCHEMA.COLUMNS
GO
GO
SELECT TABLE_NAME, COLUMN_NAME,
COLUMNPROPERTY(OBJECT_ID(TABLE_SCHEMA + '.' + TABLE_NAME), COLUMN_NAME, 'ColumnID') AS COLUMN_ID,
DATA_TYPE
FROM SmartHire.INFORMATION_SCHEMA.COLUMNS
GO
Output
TblBankDetails BankID 1 int
TblBankDetails BankName 2 varchar
TblContactPreferences ContactPreferenceID 1 int
Comments
Post a Comment