IF (SELECT count(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'TableName' AND COLUMN_NAME='columnName')>0
BEGIN
alter table Event ADD StoreAmount [int] NOT NULL DEFAULT 0
END
Showing posts with label 工作. Show all posts
Showing posts with label 工作. Show all posts
Wednesday, May 6, 2009
T-SQL判斷Table Column存不存在
Monday, February 23, 2009
Subscribe to:
Posts (Atom)