Tuesday, November 24, 2009

Column level query

Check the column is already exist or not, on alter the table, During the add a new column.


if Not exists (select * from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='tblMurli'
and COLUMN_NAME='My_NewColumn' )
Alter table tblMurli Add My_NewColumn numeric(18, 0)

No comments:

Post a Comment