SQL Server ':setvar' Error

后端 未结 4 1902
逝去的感伤
逝去的感伤 2020-12-12 13:15

I am trying to create some script variables in T-SQL as follows:

    /*
    Deployment script for MesProduction_Preloaded_KLM_MesSap
    */

    GO
    SET A         


        
4条回答
  •  执笔经年
    2020-12-12 13:43

    The :setvar only works in SQL command mode, so you are possibly within normal SQL execution in the management studio and have not swapped to command mode.

    This can be done through the user interface in SQL Server Management Studio by going to the "Query" menu, and selecting "SQLCMD mode."

提交回复
热议问题