2 Comments

  1. 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?

    Like

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.