Microsoft KB Archive/922548

= Error message when you run a Visual C++ application that connects to SQL Server 2005 by using ODBC: &quot;[Microsoft][ODBC SQL Server Driver][SQL Server] Could not find stored procedure 'sp_fallback_MS_sel_fb_svr'&quot; =

Article ID: 922548

Article Last Modified on 11/20/2007

-

APPLIES TO


 * Microsoft SQL Server 2005 Standard Edition
 * Microsoft SQL Server 2005 Workgroup Edition
 * Microsoft SQL Server 2005 Developer Edition
 * Microsoft SQL Server 2005 Enterprise Edition
 * Microsoft SQL Server 2005 Express Edition
 * Microsoft SQL Server 2005 Express Edition with Advanced Services
 * Microsoft SQL Server 2005 Enterprise Edition for Itanium-based Systems
 * Microsoft SQL Server 2005 Enterprise X64 Edition
 * Microsoft SQL Server 2005 Standard Edition for Itanium-based Systems
 * Microsoft SQL Server 2005 Standard X64 Edition

-





SYMPTOMS
Consider the following scenario. You create a Microsoft Visual C++ application that connects to Microsoft SQL Server 2005 by using Open Database Connectivity (ODBC). Additionally, you set the SQL_COPT_SS_FALLBACK_CONNECT attribute to the SQL_FB_ON value for the SQL Server connection. In this scenario, you receive the following error message when you run the application:

[Microsoft][ODBC SQL Server Driver][SQL Server] Could not find stored procedure 'sp_fallback_MS_sel_fb_svr'



CAUSE
This problem occurs because the ODBC driver cannot find the sp_fallback_MS_sel_fb_svr stored procedure in the master database in SQL Server 2005.

When you set the SQL_COPT_SS_FALLBACK_CONNECT attribute to the SQL_FB_ON value for the SQL Server connection, the ODBC driver calls the sp_fallback_MS_sel_fb_svr stored procedure. The sp_fallback_MS_sel_fb_svr stored procedure exists in SQL Server 2000 and in earlier versions of SQL Server. However, the sp_fallback_MS_sel_fb_svr stored procedure does not exist in SQL Server 2005.



WORKAROUND
To work around this problem, manually create a dummy sp_fallback_MS_sel_fb_svr stored procedure. To do this, run the following statements in SQL Server 2005. use master go

set nocount on set implicit_transactions off set ansi_nulls on  set quoted_identifier on    go

if object_id('sp_fallback_MS_sel_fb_svr','P') > 0 drop procedure sp_fallback_MS_sel_fb_svr go

create procedure sp_fallback_MS_sel_fb_svr @pFallbackSvrName   character varying(30)   OUTPUT as Set nocount                  on Set ansi_nulls                on

SELECT      @pFallbackSvrName   = null

Return 0 go

EXEC sp_MS_marksystemobject 'sp_fallback_MS_sel_fb_svr' go

grant execute on sp_fallback_MS_sel_fb_svr to public go

checkpoint go



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.

Keywords: kbtshoot kbprb kbexpertiseadvanced kbsql2005connect KB922548

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.