Example #1
0
        protected virtual void WriteTableConstraintScript(SqlTable table)
        {
            Throw.If(table).IsNull();

            if (!exportParams.ScriptTableConstraints)
            {
                return;
            }

            string sql = table.ScriptSchema(
                SqlScriptType.Checks |
                SqlScriptType.ForeignKeys |
                SqlScriptType.UniqueKeys);

            string objectName = table.Name + " Constraints";

            writer.WriteConstraintScript(objectName, sql);
            UpdateProgress(objectName);
        }
Example #2
0
        protected virtual void WriteTableSchemaScript(SqlTable table)
        {
            Throw.If(table).IsNull();

            if (!exportParams.ScriptTableSchema)
            {
                return;
            }

            string sql = table.ScriptSchema(SqlScriptType.Create |
                                            SqlScriptType.Drop |
                                            SqlScriptType.Defaults |
                                            SqlScriptType.Comments |
                                            SqlScriptType.Permissions |
                                            SqlScriptType.PrimaryKey);

            writer.WriteTableScript(table.Name, sql);
            UpdateProgress(table.Name);
        }