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

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