<?xml version="1.0" encoding="utf-8" ?> 
<TemplateProc>

<Script><![CDATA[
	ALTER TABLE %%TableName%% ADD %%FieldName%% %%FieldType%% NULL
]]></Script>

<ScriptFields><![CDATA[
	IF NOT EXISTS (SELECT TMP_C_NAME FROM @TMPTABLE WHERE TMP_C_NAME='%%FieldName%%')
		ALTER TABLE %%TableName%% ADD %%FieldName%% %%FieldType%% NULL
	ELSE
		ALTER TABLE %%TableName%% ALTER COLUMN %%FieldName%% %%FieldType%% NULL
]]></ScriptFields>

<ScriptDefaultTableExists><![CDATA[
	DECLARE @TMPTABLE TABLE (TMP_C_NAME NVARCHAR(128))
	CREATE TABLE #TempResult(TMP_C_NAME NVARCHAR(128))
	INSERT INTO @TMPTABLE SELECT NAME FROM SYSCOLUMNS WHERE ID = OBJECT_ID(N'[%%TableName%%]')
]]></ScriptDefaultTableExists>

<ScriptDropTempTable><![CDATA[
	DROP TABLE #TempResult
]]></ScriptDropTempTable>

</TemplateProc>