IF EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
              WHERE SYSCOLUMNS.NAME = 'HEMSIREFAALIYET' AND SYSOBJECTS.name = 'HYATISAGRITAKIP')
ALTER TABLE dbo.[HYATISAGRITAKIP] ALTER COLUMN HEMSIREFAALIYET  nvarchar(4000)  
GO

IF EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
              WHERE SYSCOLUMNS.NAME = 'UYGULAMA' AND SYSOBJECTS.name = 'HYATISAGRITAKIP')
ALTER TABLE dbo.[HYATISAGRITAKIP] ALTER COLUMN UYGULAMA  nvarchar(500)  
GO

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

ALTER TABLE HYATISAGRITAKIP ADD  ACIKLAMA [nvarchar](200) NULL
GO

UPDATE HYATISAGRITAKIP SET ACIKLAMA=SUBSTRING(HEMSIREFAALIYET,1,200)
GO