IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
               WHERE SYSCOLUMNS.NAME = 'HDOSYAID' AND SYSOBJECTS.name = 'FTRDOSYA')

ALTER TABLE dbo.FTRDOSYA ADD  HDOSYAID int  null 
go