SqlScriptDOM
SqlScriptDOM copied to clipboard
ExecuteAsClause object has wrong LastTokenIndex value
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.
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.