/// <summary>
        /// Create the template output
        /// </summary>
        public virtual string TransformText()
        {
            this.Write("\r\n");

            #line 8 "C:\Users\mcbeea\Desktop\AuditFramework\Model.AuditFramework\T4Templates\CreateTrackingTable.tt"

            SchemaDataSet schemaDataSet = _params.SchemaDataSet;
            SchemaDataSet.SchemaPrimaryKeysDataTable primaryKeysTable = schemaDataSet.SchemaPrimaryKeys;
            EnumerableRowCollection <SchemaDataSet.SchemaPrimaryKeysRow> primaryKeysRows = primaryKeysTable.AsEnumerable();
            var primaryKeysQuery = from primaryKeysRow in primaryKeysRows
                                   where primaryKeysRow.TABLE_SCHEMA.Equals(_schema, StringComparison.OrdinalIgnoreCase)
                                   where primaryKeysRow.TABLE_NAME.Equals(_tableName, StringComparison.OrdinalIgnoreCase)
                                   select primaryKeysRow;


            #line default
            #line hidden
            this.Write("IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N\'[");

            #line 17 "C:\Users\mcbeea\Desktop\AuditFramework\Model.AuditFramework\T4Templates\CreateTrackingTable.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(_params.AuditingSchema));

            #line default
            #line hidden
            this.Write("].[");

            #line 17 "C:\Users\mcbeea\Desktop\AuditFramework\Model.AuditFramework\T4Templates\CreateTrackingTable.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(_trackingTableName));

            #line default
            #line hidden
            this.Write("]\') AND OBJECTPROPERTY(id, N\'IsUserTable\') = 1)\r\nBEGIN\r\n\tCREATE TABLE [");

            #line 19 "C:\Users\mcbeea\Desktop\AuditFramework\Model.AuditFramework\T4Templates\CreateTrackingTable.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(_params.AuditingSchema));

            #line default
            #line hidden
            this.Write("].[");

            #line 19 "C:\Users\mcbeea\Desktop\AuditFramework\Model.AuditFramework\T4Templates\CreateTrackingTable.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(_trackingTableName));

            #line default
            #line hidden
            this.Write("]\r\n\t\t(\r\n    \t  [TrackºId] [bigint]\r\n");

            #line 22 "C:\Users\mcbeea\Desktop\AuditFramework\Model.AuditFramework\T4Templates\CreateTrackingTable.tt"
            foreach (SchemaDataSet.ColumnsRow columnsRow in _targetTableColumns)
            {
            #line default
            #line hidden
                this.Write("\t\t, [");

            #line 23 "C:\Users\mcbeea\Desktop\AuditFramework\Model.AuditFramework\T4Templates\CreateTrackingTable.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(columnsRow.COLUMN_NAME));

            #line default
            #line hidden
                this.Write("] ");

            #line 23 "C:\Users\mcbeea\Desktop\AuditFramework\Model.AuditFramework\T4Templates\CreateTrackingTable.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(columnsRow.DATA_TYPE.ToUpperInvariant()));

            #line default
            #line hidden

            #line 23 "C:\Users\mcbeea\Desktop\AuditFramework\Model.AuditFramework\T4Templates\CreateTrackingTable.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(SchemaHelper.DataTypeDetail(columnsRow)));

            #line default
            #line hidden
                this.Write(" NULL\r\n");

            #line 24 "C:\Users\mcbeea\Desktop\AuditFramework\Model.AuditFramework\T4Templates\CreateTrackingTable.tt"
            }

            #line default
            #line hidden
            this.Write("\r\n\t\t, CONSTRAINT [PK_");

            #line 26 "C:\Users\mcbeea\Desktop\AuditFramework\Model.AuditFramework\T4Templates\CreateTrackingTable.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(_trackingTableName));

            #line default
            #line hidden
            this.Write("_TrackºId] PRIMARY KEY CLUSTERED \r\n\t\t\t(\r\n\t\t\t\t[TrackºId] ASC\r\n\t\t\t)\r\n\t\t\tON [");

            #line 30 "C:\Users\mcbeea\Desktop\AuditFramework\Model.AuditFramework\T4Templates\CreateTrackingTable.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(_params.AuditingFileGroup));

            #line default
            #line hidden
            this.Write("]\r\n\t\t\t\r\n\t\t, CONSTRAINT [FK_");

            #line 32 "C:\Users\mcbeea\Desktop\AuditFramework\Model.AuditFramework\T4Templates\CreateTrackingTable.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(_trackingTableName));

            #line default
            #line hidden
            this.Write("_AuditMaster] FOREIGN KEY\r\n\t\t\t(\r\n\t\t\t\t[TrackºId]\r\n\t\t\t) \r\n\t\t\tREFERENCES [");

            #line 36 "C:\Users\mcbeea\Desktop\AuditFramework\Model.AuditFramework\T4Templates\CreateTrackingTable.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(_params.AuditingSchema));

            #line default
            #line hidden
            this.Write("].[AuditMaster]\r\n\t\t\t(\r\n\t\t\t\t[TrackºId]\r\n\t\t\t) \r\n\t\t\tON UPDATE CASCADE \r\n\t \t\tON DELET" +
                       "E CASCADE \t \r\n\t \t)\r\n\t\tON [");

            #line 43 "C:\Users\mcbeea\Desktop\AuditFramework\Model.AuditFramework\T4Templates\CreateTrackingTable.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(_params.AuditingFileGroup));

            #line default
            #line hidden
            this.Write("];\r\n\r\n\tCREATE NONCLUSTERED INDEX [IX_");

            #line 45 "C:\Users\mcbeea\Desktop\AuditFramework\Model.AuditFramework\T4Templates\CreateTrackingTable.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(_trackingTableName));

            #line default
            #line hidden
            this.Write("_PK] ON [");

            #line 45 "C:\Users\mcbeea\Desktop\AuditFramework\Model.AuditFramework\T4Templates\CreateTrackingTable.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(_params.AuditingSchema));

            #line default
            #line hidden
            this.Write("].[");

            #line 45 "C:\Users\mcbeea\Desktop\AuditFramework\Model.AuditFramework\T4Templates\CreateTrackingTable.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(_trackingTableName));

            #line default
            #line hidden
            this.Write("] \r\n\t(\r\n");

            #line 47 "C:\Users\mcbeea\Desktop\AuditFramework\Model.AuditFramework\T4Templates\CreateTrackingTable.tt"

            bool first = true;
            PushIndent("        ");
            foreach (SchemaDataSet.SchemaPrimaryKeysRow primaryKeysRow in primaryKeysQuery)
            {
                if (!first)
                {
                    Write(", ");
                }
                WriteLine("[" + primaryKeysRow.COLUMN_NAME + "] ASC");
                first = false;
            }
            PopIndent();


            #line default
            #line hidden
            this.Write("\t)\r\n\tINCLUDE \r\n\t(\r\n\t\t[TrackºId]\r\n\t) \r\n\tWITH \r\n\t(\r\n\t  STATISTICS_NORECOMPUTE = OFF" +
                       "\r\n\t, SORT_IN_TEMPDB = OFF\r\n\t, IGNORE_DUP_KEY = OFF\r\n\t, DROP_EXISTING = OFF\r\n\t, O" +
                       "NLINE = OFF\r\n\t, ALLOW_ROW_LOCKS = ON\r\n\t, ALLOW_PAGE_LOCKS = ON\r\n\t)\r\n\tON [");

            #line 76 "C:\Users\mcbeea\Desktop\AuditFramework\Model.AuditFramework\T4Templates\CreateTrackingTable.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(_params.AuditingFileGroup));

            #line default
            #line hidden
            this.Write("];\r\n\r\nEND\r\nGO\r\n");
            return(this.GenerationEnvironment.ToString());
        }