Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Getting below error when fetching store procedures from new server DB, after migration of DB to new server .
Please help how i can solve this issue .


System.Data.SqlClient.SqlException: Incorrect syntax near '50000'. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()

What I have tried:

i have updated web.config file with new server connection. I am able to fetch new server DB data but not able to view any store procedure .
Posted
Updated 3-May-20 9:08am
Comments
MadMyche 2-May-20 15:43pm    
And the code for this Stored Procedure is where?
shwetaliv 3-May-20 6:13am    
its all there on new migrated DB .I am able to fetch any table data, read/write from new server DB .But not able to open any SQL store procedure .so same getting above error for login SP execution .
Error for any SP is :Index was outside the bounds of the array.

MadMyche 3-May-20 7:23am    
Can you run the SP from SSMS?

1 solution

1. It might be the Caching problem, try restarting the SSMS.
2. Some times you might get this error if old SSMS doesn't match with newer one, try upgrading your SQL Version to Same as your SQL Server Version. If you are working on one server, for example, SQL-2008 and trying to query another server that is running on SQL-2012 this type of problem occurs.
But, in most cases, this problem resolves after restarting SSMS.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900