Enable SET CONTEXT_INFO
I'm using the command SET CONTEXT_INFO to pass information about current User and Application (among others) to be used with insert and updating in all the tables. In SQL Azure this command is not available because, I think, it is used to set the session GUID:
"When the client application connects to SQL Azure, CONTEXT_INFO (Transact-SQL) is set with a unique session specific GUID value automatically. Retrieve this GUID value and use it in your application to trace the connectivity problems."
Thanks for your feedback. We now have the next generation of Azure SQL DB in public preview in the US and GA in Europe.
Specifically it supports SET CONTEXT_INFO
Details here http://azure.microsoft.com/blog/2014/12/11/preview-available-for-next-generation-of-azure-sql-database/ and https://msdn.microsoft.com/library/azure/ee336281.aspx#UpgradeSterling
Tim Cook commented
Similar to Juan's post, when I connect to SQL Azure database v13.0.201, i can see that CONTEXT_INFO already has data. I have not set this anywhere else so can only assume it has been set by SQL Azure for some purpose.
Pls can you confirm if it is safe to overwrite this with my own data?
I have just tested this with the Azure SQL Database V12 and it seems like custom CONTEXT_INFO is supported.
Maysar Salem commented
Is there any news? till 9.2.2015 the CONTEXT_INFO dose not work:-(
Mark Hildreth commented
Nice! We are taking a similar approach and had to work around this limitation by creating a global temp table. When I googled this, there were a couple of others in the same boat. Glad to hear this is being remedied!
Venkatappa Reddy K commented
Sesha Ram prasad commented
or work around
LVPrasad Y commented
Or supply an alternative