IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
              WHERE SYSCOLUMNS.NAME = 'FOLDERID' AND SYSOBJECTS.name = 'HSENCARDDOKUMAN')
ALTER TABLE HSENCARDDOKUMAN ADD FOLDERID int NULL
go


