Declare @Id Int                               
Select @Id = Id From sysobjects Where Name = 'HIX_Prescriptions'
if  Exists(SELECT * FROM syscolumns WHERE id = @Id  and Name = 'ExceptionCode')
Alter Table HIX_Prescriptions Alter Column ExceptionCode nvarchar(MAX)
   
if  Exists(SELECT * FROM syscolumns WHERE id = @Id  and Name = 'ExceptionMessage')
Alter Table HIX_Prescriptions Alter Column ExceptionMessage nvarchar(MAX)

if  Exists(SELECT * FROM syscolumns WHERE id = @Id  and Name = 'ExceptionStacktrace')
Alter Table HIX_Prescriptions Alter Column ExceptionStacktrace nvarchar(MAX)


if  Exists(SELECT * FROM syscolumns WHERE id = @Id  and Name = 'PayloadClass')
Alter Table HIX_Prescriptions Alter Column PayloadClass nvarchar(MAX)
   
     
if  Exists(SELECT * FROM syscolumns WHERE id = @Id  and Name = 'ConversationId')
Alter Table HIX_Prescriptions Alter Column ConversationId nvarchar(MAX)
               