public override void GenerateCreateProcedureScript(DBSchemaSproc schemaSproc, DBScript script)
        {
            if (null == schemaSproc)
            {
                throw new ArgumentNullException("schemaSproc");
            }

            if (string.IsNullOrEmpty(schemaSproc.Name))
            {
                throw new ArgumentNullException("schemaSproc.Name");
            }

            if (schemaSproc.Type != DBSchemaTypes.StoredProcedure)
            {
                throw new ArgumentOutOfRangeException("schemaSproc.Type");
            }

            if (null == script)
            {
                throw new ArgumentNullException("script");
            }

            this._buildingsproc = true;

            this.BeginCreate(DBSchemaTypes.StoredProcedure, null);
            this.WriteSource(schemaSproc.Catalog, schemaSproc.Schema, schemaSproc.Name);

            try
            {
                GenerateRoutineParameters(schemaSproc, true);

                //now just output the script as SQL
                script.BuildStatement(this);
            }
            finally
            {
                this._buildingsproc = false;
            }
        }
        public override void GenerateCreateFunctionScript(DBSchemaFunction schemaFunc, DBScript script)
        {
            if (null == schemaFunc)
            {
                throw new ArgumentNullException("schemaFunc");
            }
            if (string.IsNullOrEmpty(schemaFunc.Name))
            {
                throw new ArgumentNullException("schemaFunc.Name");
            }
            if (schemaFunc.Type != DBSchemaTypes.Function)
            {
                throw new ArgumentOutOfRangeException("schemaFunc.Type");
            }
            if (null == script)
            {
                throw new ArgumentNullException("script");
            }

            this._buildingsproc = true;
            this.BeginCreate(DBSchemaTypes.Function, null);
            this.WriteSource(schemaFunc.Catalog, schemaFunc.Schema, schemaFunc.Name);

            try
            {
                this.GenerateRoutineParameters(schemaFunc, false);
                WriteFunctionReturns(schemaFunc.ReturnParameter.DbType, schemaFunc.ReturnParameter.ParameterSize);
                this.BeginNewLine();

                script.BuildStatement(this);
            }
            finally
            {
                this._buildingsproc = false;
            }
        }