0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

TSQLScriptDomParserでのSQLからのテーブル列挙のためのxpathまとめ

Last updated at Posted at 2022-05-29

TSQLScriptDomParserでのSQLからのテーブル列挙のためのxpathまとめ

xpath
selectのfrom //node[@class='FromClause']/children[@type='TableReferences']/node[@class='NamedTableReference']/children[@type='SchemaObject']/node[@class='SchemaObjectName']
selectのjoin //node[@class='QualifiedJoin']/children[@type='FirstTableReference' or @type='SecondTableReference']/node[@class='NamedTableReference']/children[@type='SchemaObject']/node[@class='SchemaObjectName']
insert //node[@class='InsertSpecification']/children[@type='Target']/node[@class='NamedTableReference']/children[@type='SchemaObject']/node[@class='SchemaObjectName']
update //node[@class='UpdateSpecification']/children[@type='Target']/node[@class='NamedTableReference']/children[@type='SchemaObject']/node[@class='SchemaObjectName']
delete //node[@class='DeleteSpecification']/children[@type='Target']/node[@class='NamedTableReference']/children[@type='SchemaObject']/node[@class='SchemaObjectName']
merge //node[@class='MergeSpecification']/children[@type='Target']/node[@class='NamedTableReference']/children[@type='SchemaObject']/node[@class='SchemaObjectName']
truncate //node[@class='TruncateTableStatement']/children[@type='TableName']/node[@class='SchemaObjectName']
select into //node[@class='SelectStatement']/children[@type='Into']/node[@class='SchemaObjectName']
bulk insert //node[@class='BulkInsertStatement']/children[@type='To']/node[@class='SchemaObjectName']
  • 出力の解釈
項目
サーバ名 /node/children[@type='ServerIdentifier']/node のvalue属性
データベース名 /node/children[@type='DatabaseIdentifier']/node のvalue属性
スキーマ名 /node/children[@type='SchemaIdentifier']/node のvalue属性
テーブル名 /node/children[@type='BaseIdentifier']/node のvalue属性
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?