本文整理汇总了C#中SqlWriter.WriteScriptSequence方法的典型用法代码示例。如果您正苦于以下问题:C# SqlWriter.WriteScriptSequence方法的具体用法?C# SqlWriter.WriteScriptSequence怎么用?C# SqlWriter.WriteScriptSequence使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SqlWriter
的用法示例。
在下文中一共展示了SqlWriter.WriteScriptSequence方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteTo
public override void WriteTo(SqlWriter writer) {
if (partitions.Count > 0) {
writer.WriteKeyword("PARTITION BY ");
writer.WriteScriptSequence(partitions, WhitespacePadding.None, w => w.Write(", "));
if (orders.Count > 0) {
writer.Write(' ');
}
}
if (orders.Count > 0) {
writer.WriteKeyword("ORDER BY ");
writer.WriteScriptSequence(orders, WhitespacePadding.None, w => w.Write(", "));
}
}
示例2: WriteTo
public override void WriteTo(SqlWriter writer) {
WriteCommentsTo(writer);
writer.WriteKeyword("RAISERROR");
writer.Write('(');
using (writer.Indent()) {
writer.WriteScriptSequence(arguments, WhitespacePadding.None, w => w.Write(", "));
}
writer.Write(')');
if (options.Count > 0) {
writer.WriteKeyword(" WITH ");
writer.WriteScriptSequence(options, WhitespacePadding.None, w => w.Write(", "));
}
}
示例3: WriteTo
public override void WriteTo(SqlWriter writer) {
writer.WriteKeyword("FOR UPDATE");
if (columns.Count > 0) {
writer.WriteKeyword(" OF ");
writer.WriteScriptSequence(columns, WhitespacePadding.None, w => w.Write(", "));
}
}
示例4: WriteTo
public override void WriteTo(SqlWriter writer) {
base.WriteTo(writer);
writer.WriteKeyword("REFERENCES ");
writer.WriteScript(tableName, WhitespacePadding.None);
writer.WriteScript(refColumnName, WhitespacePadding.SpaceBefore);
writer.WriteScriptSequence(keyActions, WhitespacePadding.SpaceBefore, null);
}
示例5: WriteTo
public override void WriteTo(SqlWriter writer) {
WriteCommentsTo(writer);
writer.WriteKeyword("BEGIN TRY");
using (writer.Indent()) {
writer.WriteScriptSequence(tryStatements, WhitespacePadding.NewlineBefore, w => w.Write(';'));
writer.WriteLine(";");
}
writer.WriteKeyword("END TRY");
writer.WriteLine();
writer.WriteKeyword("BEGIN CATCH");
using (writer.Indent()) {
writer.WriteScriptSequence(catchStatements, WhitespacePadding.NewlineBefore, w => w.Write(';'));
writer.WriteLine(";");
}
writer.WriteKeyword("END CATCH");
}
示例6: WriteTo
public override void WriteTo(SqlWriter writer) {
WriteCommentsTo(writer);
writer.WriteKeyword("OPTION ");
writer.Write('(');
writer.WriteScriptSequence(options, WhitespacePadding.None, w => w.Write(", "));
writer.Write(')');
}
示例7: WriteToInternal
protected virtual void WriteToInternal(SqlWriter writer) {
writer.WriteScript(function, WhitespacePadding.None);
if (functions.Count > 0) {
writer.Write('.');
writer.WriteScriptSequence(functions, WhitespacePadding.None, w => w.Write('.'));
}
}
示例8: AnyStatement
public AnyStatement(Identifier identifier, Sequence<Expression> expressions) {
using (StringWriter stringWriter = new StringWriter()) {
SqlWriter statementWriter = new SqlWriter(stringWriter, DatabaseEngine.Unknown);
statementWriter.WriteIdentifier(identifier.Value);
statementWriter.WriteScriptSequence(expressions, WhitespacePadding.SpaceBefore, null);
statementText = stringWriter.ToString();
}
}
示例9: WriteTo
public override void WriteTo(SqlWriter writer) {
WriteCommentsTo(writer);
writer.WriteKeyword("INSERT ");
if (columnNames.Count > 0) {
writer.Write('(');
writer.WriteScriptSequence(columnNames, WhitespacePadding.None, w => w.Write(", "));
writer.Write(") ");
}
if (expressions.Count > 0) {
writer.WriteKeyword("VALUES ");
writer.Write('(');
writer.WriteScriptSequence(expressions, WhitespacePadding.None, w => w.Write(", "));
writer.Write(')');
} else {
writer.WriteKeyword("DEFAULT VALUES");
}
}
示例10: WriteToInternal
protected override void WriteToInternal(SqlWriter writer) {
if (columnNames.Count > 0) {
writer.Write(" (");
writer.WriteScriptSequence(columnNames, WhitespacePadding.None, w => w.Write(", "));
writer.Write(")");
}
writer.WriteScript(output, WhitespacePadding.NewlineBefore);
}
示例11: WriteTo
public override void WriteTo(SqlWriter writer) {
if (HasValue) {
writer.WriteKeyword("WITH ");
writer.Write('(');
writer.WriteScriptSequence(hints, WhitespacePadding.None, w => w.Write(", "));
writer.Write(')');
}
}
示例12: WriteTo
public override void WriteTo(SqlWriter writer) {
writer.Write('(');
using (writer.Indent()) {
writer.WriteScript(inner, WhitespacePadding.NewlineBefore);
writer.WriteScriptSequence(joins, WhitespacePadding.NewlineBefore, null);
}
writer.WriteLine();
writer.Write(')');
}
示例13: WriteTo
public override void WriteTo(SqlWriter writer) {
if (HasValue) {
writer.WriteKeyword("OUTPUT ");
using (writer.Indent()) {
writer.WriteScriptSequence(columnItems, WhitespacePadding.None, w => w.Write(", "));
if (destinationName != null) {
writer.WriteLine();
writer.WriteKeyword("INTO ");
writer.WriteScript(destinationName, WhitespacePadding.None);
if (destinationColumnNames.Count > 0) {
writer.Write(" (");
writer.WriteScriptSequence(destinationColumnNames, WhitespacePadding.None, w => w.Write(", "));
writer.Write(')');
}
}
}
}
}
示例14: WriteTo
public override void WriteTo(SqlWriter writer) {
WriteCommentsTo(writer);
writer.WriteKeyword("BEGIN");
writer.WriteLine();
using (writer.Indent()) {
writer.WriteScriptSequence(statements, WhitespacePadding.None, w => w.WriteLine(";"));
writer.WriteLine(";");
}
writer.WriteKeyword("END");
}
示例15: WriteTo
public override void WriteTo(SqlWriter writer) {
WriteCommentsTo(writer);
if (HasValue) {
writer.WriteKeyword("WITH ");
if (namespaces.Count > 0) {
using (writer.Indent()) {
writer.WriteKeyword("XMLNAMESPACES ");
writer.Write('(');
writer.WriteScriptSequence(namespaces, WhitespacePadding.NewlineBefore, w => w.Write(','));
}
writer.WriteLine();
writer.Write(')');
if (commonTableExpressions.Count > 0) {
writer.WriteLine(",");
}
}
writer.WriteScriptSequence(commonTableExpressions, WhitespacePadding.None, w => w.WriteLine(","));
}
}