My Blog List

hotinit.com. Powered by Blogger.

Search This Blog

Add a column to a table if it does not exits

Thursday, 1 September 2011



Add a column to a table if it does not exits

IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.COLUMNS         
WHERE TABLE_NAME = 'TblSourceMaster' AND COLUMN_NAME = 'CorpSourceId')         
BEGIN         
   ALTER TABLE TblSourceMaster ADD CorpSourceId bigint NULL         
END        

No comments:

Post a Comment

 

Blogger news

Blogroll

Most Reading

8.6/10