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

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

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

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