Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.

  • I am getting error [[Msg 116, Level 16, State 1, Line 7 .Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.]] for the below script.

    Any suggestion pls.

    ==============================================

    Declare @mSql2 Nvarchar(max)

    SET @mSql2= (select * from Tablename)

    ================================================

  • charipg (4/28/2015)


    I am getting error [[Msg 116, Level 16, State 1, Line 7 .Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.]] for the below script.

    Any suggestion pls.

    ==============================================

    Declare @mSql2 Nvarchar(max)

    SET @mSql2= (select * from Tablename)

    ================================================

    Looks like you want to put the select statement in the @mSql2 variable:

    Declare @mSql2 nvarchar(max);

    SET @mSql2= N'select * from Tablename';

  • thank you Lynn Pettis!!!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply