USE is not supported to switch between dbs

https://support.microsoft.com/en-us/help/3035071/fix-error-when-you-run-a-query-that-contains-use-database-name-or-exec

Symptoms


Assume that you use Microsoft SQL Server 2014 Management Studio (SSMS) and connect to Azure SQL Database. When you run the command Execute Stored_Procedure_name from the right-click shortcut menu of a stored procedure, after filling out the fields in the appearing dialog window and clicking OK, you receive the following error messages:


Msg 40508, Level 16, State 1, Line 1
USE statement is not supported to switch between databases. Use a new connection to connect to a different database.

Msg 2812, Level 16, State 62, Line 6
Could not find stored procedure 'Execute Stored_Procedure_name'.

Cause


This issue occurs because Azure SQL Database does not support the "use" command.

Workaround


   

To work around this issue, select the correct database first in the SSMS database drop-down list, and then execute the stored procedure.


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章