Just a quick shout out that I have published a blog about the ScriptDom parser on the Azure Dev blog: Programmatically parsing Transact SQL (T-SQL) with the ScriptDom parser | Azure SQL Devs’ Corner (microsoft.com)
Just a quick shout out that I have published a blog about the ScriptDom parser on the Azure Dev blog: Programmatically parsing Transact SQL (T-SQL) with the ScriptDom parser | Azure SQL Devs’ Corner (microsoft.com)
Hi
I’m using TSql140Parser (SQL 2017)
I have a question about this expression:
mergeStatement.MergeSpecification.TableAlias.Value
The alias exists in the merge statement, but is not returned. or not found. That only happens at the target.
In the USING area, the alias is correctly returned by all table references.
/ * Here the TSQL statement for a simple merge statement * /
MERGE dbo.Table_1 AS t
USING dbo.Table_3 AS s
ON t.ID = s.ID
AND t.feld1 = s.feld1
WHEN MATCHED
THEN UPDATE SET t.Date = CONVERT (VARCHAR (50), GETDATE ());
The target table obviously has the alias “t” but is not output.
Can you explain why Or what do I have to do to get the alias?
LikeLike
Hello, Frank. Sorry for not seeing this earlier. I cannot reproduce the issue with current latest ScriptDom (from DacFx 160.6161.0) and TSqlParser140 or above. I suggest you update your version of ScriptDom and then if the issue still persists, please open an Issue on the DacFx GithHub page: https://github.com/microsoft/DacFx/issues
LikeLike