Options

SESSION_USER function

dan67890dan67890 Posts: 21
edited November 12, 2007 12:48PM in SQL Prompt Previous Versions
SQL Prompt adds a () to SESSION_USER when it inserts it like so:

DECLARE @su NVARCHAR(128)
SET @su = SESSION_USER() -- SQL Prompt added the ()

However SESSION_USER() generates a syntax error. SESSION_USER has to be used without the () like

DECLARE @su NVARCHAR(128)
SET @su = SESSION_USER -- this works


Dan

Comments

  • Options
    Hello,

    I'm afraid that this is a bug in the current version of SQL Prompt. Unfortunately we treat all functions the same, regardless of whether they take parameters or not. I have raised this problem internally and would hope that it will get sorted out in the next release.

    Many thanks, Tom
Sign In or Register to comment.