Getting error in SQL 2012 working fine in 2016
-
Hi when I execute the code in 2012 SQL Server we are getting following error: Could not find stored procedure 'sp_set_session_context'. Automation Exception: Could not find stored procedure 'sp_set_session_context' We tested in 2016 server it is working fine but when we moved to 2012 this is failing. when I searched online I come to know that 'sp_set_session_context' it is new future introduced in 2016, I need relevant commands to implement same in 2012 server..
-
Hi when I execute the code in 2012 SQL Server we are getting following error: Could not find stored procedure 'sp_set_session_context'. Automation Exception: Could not find stored procedure 'sp_set_session_context' We tested in 2016 server it is working fine but when we moved to 2012 this is failing. when I searched online I come to know that 'sp_set_session_context' it is new future introduced in 2016, I need relevant commands to implement same in 2012 server..
GaneshVidiyala wrote:
I need relevant commands to implement same in 2012 server..
The stored procedure itself uses something that doesn't exist in the older version. So that isn't going to help you. You are not going to easily replace that. 1. It is just a name/value store HOWEVER it is tied to the transaction. 2. So each transaction you would need to 'create' a corresponding store 3. For each transaction you would need to destroy the corresponding store. If you fail to do this you will eventually have a data problem. 4. Then you can use the store, maybe. I suspect it is easier to just re-write the functionality. I suspect someone just used it so they wouldn't need to pass data around. So pass the data. And/or untie it from the transaction - just tie it to the processes that use it.