SqlScriptDOM icon indicating copy to clipboard operation
SqlScriptDOM copied to clipboard

ExecuteAsClause object has wrong LastTokenIndex value

Open IVNSTN opened this issue 10 months ago • 0 comments

ScriptDom version: 161.9142.1 Compatibility level: 150

Sample code:

CREATE PROCEDURE foo
WITH EXECUTE AS OWNER
AS;

Here for the ExecuteAsClause instance values of FirstTokenIndex and LastTokenIndex are equal and pointing to the token representing word EXECUTE which is wrong: FirstTokenIndex is fine but LastTokenIndex should be pointing to the token representing OWNER keyword.

Image

If EXECUTE AS is specified with user name literal then everything is fine, LastTokenIndex is correct.


ExecuteAsClause.LastTokenIndex should be pointing to the very last word of the clause.

IVNSTN avatar Feb 28 '25 14:02 IVNSTN