I have few batch jobs that are running for years on SQL server 2000 successfully. Now we are migrating to SQL server 2005.
the batch file uses BCP query out. Some of the procedures have #temp table. thus in the batch file, we had to use "set fmtonly off". When running these files on SQL server 2005, we get following error:
SQLState = S1010, NativeError = 0 Error = [Microsoft][SQL Native Client]Function sequence error
If I remove "set fmtonly only" BCP does not recognize #temp table.
I cannot post my company code but I wrote this small proc for testing:
And bcp out as follows from batch file:
We are in the urgent need. Any help that does not require change in the SP is greatly appreciated.
It might be that the BCP is being thrown by the first "SELECT" statement. Try changing your stored procedure so that the first line is
and then carry on with the rest of your SP as written, ie:
answered Jun 11, 2010 at 12:34 PM
Has there been a solution for this? I'm sitting with the same problem and havelooked all over, can't find anything.
answered May 04, 2016 at 01:30 PM