as
set@tablename=ltrim(rtrim(@tablename))
set@Columnname=ltrim(rtrim(@Columnname))
set@ColumnType=ltrim(rtrim(@ColumnType))
declare@stringvarchar(8000)
IFnotEXISTS(select*fromsyscolumnswhereid=object_id(@tablename)andname=@Columnname)
begin
select@string=ALTERTABLE+@tablename+ADD[+ltrim(rtrim(@Columnname))+]+@ColumnType+null
print@string
execute(@string)
end