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); }
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()); }