IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
               WHERE SYSCOLUMNS.NAME = 'USERID' AND SYSOBJECTS.name = 'HMUAYENEEK3000')
ALTER TABLE dbo.HMUAYENEEK3000 ADD
    USERID INT
GO   

IF NOT EXISTS(select sysobjects.id from sysconstraints inner join sysobjects on sysobjects.id = constid where sysobjects.name = 'FK_HMUAYENEEK3000_USERID' and xtype='F')
ALTER TABLE [dbo].HMUAYENEEK3000  WITH NOCHECK ADD  CONSTRAINT [FK_HMUAYENEEK3000_USERID] FOREIGN KEY([USERID])
REFERENCES [dbo].[USER] ([USERID])
GO

IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
               WHERE SYSCOLUMNS.NAME = 'BILGIALINANADISOYADI' AND SYSOBJECTS.name = 'HMUAYENEEK3000')
ALTER TABLE dbo.HMUAYENEEK3000 ADD
    BILGIALINANADISOYADI NVARCHAR(50)
GO   

IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
               WHERE SYSCOLUMNS.NAME = 'BILGIALINANTELEFON' AND SYSOBJECTS.name = 'HMUAYENEEK3000')
ALTER TABLE dbo.HMUAYENEEK3000 ADD
    BILGIALINANTELEFON NVARCHAR(20)
GO