IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
               WHERE SYSCOLUMNS.NAME = 'HASTASIZMIKTAR' AND SYSOBJECTS.name = 'STOKMIADBAKIYE')
	 ALTER TABLE [STOKMIADBAKIYE]
		ADD [HASTASIZMIKTAR] float(53) NULL 
GO

UPDATE STOKMIADBAKIYE SET HASTASIZMIKTAR = MIKTAR
WHERE HASTASIZMIKTAR IS NULL
GO	

ALTER TABLE [STOKMIADBAKIYE]
  ALTER COLUMN [HASTASIZMIKTAR] float(53) NOT NULL 
GO

if NOT EXISTS (
select * from syscolumns inner join 
     sysobjects on syscolumns.id = sysobjects.id inner join
     sysconstraints on constid = syscolumns.cdefault 
where sysobjects.name = 'STOKMIADBAKIYE' and syscolumns.name='HASTASIZMIKTAR')
ALTER TABLE [STOKMIADBAKIYE] 
  ADD cONSTRAINT DF_STOKMIADBAKIYE_HASTASIZMIKTAR DEFAULT 0 FOR HASTASIZMIKTAR
GO		
		

	
