コード例 #1
0
        protected virtual void WriteTableIndexScript(SqlTable table)
        {
            Throw.If(table).IsNull();

            if (!exportParams.ScriptTableIndexes)
            {
                return;
            }

            string sql        = table.ScriptIndexes();
            string objectName = table.Name + " Indexes";

            writer.WriteIndexScript(objectName, sql);
            UpdateProgress(objectName);
        }
コード例 #2
0
        protected void ScriptTableIndexes(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} indexes", tableName);

            messageManager.OnScriptMessage(msg);

            SqlScript script = new SqlScript();

            foreach (IIndex index in table.Indexes)
            {
                msg = string.Format("Scripting index {0}", index.Name);
                messageManager.OnScriptMessage(msg);

                script += scriptBuilder.Create(index);
            }

            writer.WriteIndexScript(tableName, script.ToScript());
        }