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

IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
              WHERE SYSCOLUMNS.NAME = 'HDPOLICENO' AND SYSOBJECTS.name = 'HDOSYA')
ALTER TABLE dbo.[HDOSYA] ADD HDPOLICENO NVARCHAR(50) null
go

IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
              WHERE SYSCOLUMNS.NAME = 'ONPROVIZYONNO' AND SYSOBJECTS.name = 'HDOSYA')
ALTER TABLE dbo.[HDOSYA] ADD ONPROVIZYONNO NVARCHAR(100) null
go

IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
              WHERE SYSCOLUMNS.NAME = 'HDMUSTERINO' AND SYSOBJECTS.name = 'HDOSYA')
ALTER TABLE dbo.[HDOSYA] ADD HDMUSTERINO NVARCHAR(50) null
go

IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
              WHERE SYSCOLUMNS.NAME = 'HDKARTNO' AND SYSOBJECTS.name = 'HDOSYA')
ALTER TABLE dbo.[HDOSYA] ADD HDKARTNO NVARCHAR(50) null
go

IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
              WHERE SYSCOLUMNS.NAME = 'HDTSS' AND SYSOBJECTS.name = 'HDOSYA')
ALTER TABLE dbo.[HDOSYA] ADD HDTSS BIT null
go

IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
              WHERE SYSCOLUMNS.NAME = 'HDOSSENTEGRE' AND SYSOBJECTS.name = 'HDOSYA')
ALTER TABLE dbo.[HDOSYA] ADD HDOSSENTEGRE BIT null
go


