-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathSqlScriptGeneratorVisitor.OffsetClause.cs
More file actions
47 lines (40 loc) · 1.74 KB
/
SqlScriptGeneratorVisitor.OffsetClause.cs
File metadata and controls
47 lines (40 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//------------------------------------------------------------------------------
// <copyright file="SqlScriptGeneratorVisitor.OffsetClause.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
using Microsoft.SqlServer.TransactSql.ScriptDom;
namespace Microsoft.SqlServer.TransactSql.ScriptDom.ScriptGenerator
{
partial class SqlScriptGeneratorVisitor
{
public override void ExplicitVisit(OffsetClause node)
{
AlignmentPoint start = new AlignmentPoint();
MarkAndPushAlignmentPoint(start);
if (node.OffsetExpression != null)
{
GenerateIdentifier(CodeGenerationSupporter.Offset);
GenerateSpaceAndFragmentIfNotNull(node.OffsetExpression);
GenerateSpaceAndIdentifier(CodeGenerationSupporter.Rows);
}
if (node.FetchExpression != null)
{
if (node.OffsetExpression != null)
{
GenerateSpace();
}
GenerateKeyword(TSqlTokenType.Fetch);
if (node.WithApproximate)
{
GenerateSpaceAndIdentifier(CodeGenerationSupporter.Approximate);
}
GenerateSpaceAndIdentifier(CodeGenerationSupporter.Next);
GenerateSpaceAndFragmentIfNotNull(node.FetchExpression);
GenerateSpaceAndIdentifier(CodeGenerationSupporter.Rows);
GenerateSpaceAndIdentifier(CodeGenerationSupporter.Only);
}
PopAlignmentPoint();
}
}
}