Exemplo n.º 1
0
        protected void ScriptTableSchema(ITable table, IScriptWriter writer)
        {
            Throw.If(table, "table").IsNull();
            Throw.If(writer, "writer").IsNull();

            string tableName = DbObjectName.CreateDbObjectName(table);

            string msg = string.Format("Scripting {0} table schema", tableName);

            messageManager.OnScriptMessage(msg);

            SqlScript script = scriptBuilder.Create(table);

            writer.WriteTableScript(tableName, script.ToScript());
        }
Exemplo n.º 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);
        }