FIX: Error when you run a query that contains "Use database_name" or "Execute Stored_Procedure_name" command

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.
Resolution
Cumulative Update information
The issue was first fixed in the following cumulative update of SQL Server.

Recommendation: Install the latest cumulative update for SQL Server
Each new cumulative update for SQL Server contains all the hotfixes and all the security fixes that were included with the previous cumulative update. We recommend that you download and install the latest cumulative updates for SQL Server:
Workaround
To work around this issue, select the correct database first in the SSMS database drop-down list, and then execute the stored procedure.
Status
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
Properties

Article ID: 3035071 - Last Review: 06/22/2015 15:51:00 - Revision: 2.0

Microsoft SQL Server 2014 Developer, Microsoft SQL Server 2014 Enterprise, Microsoft SQL Server 2014 Standard, Microsoft SQL Server 2014 Service Pack 1

  • kbqfe kbfix kbsurveynew kbexpertiseadvanced KB3035071
Feedback