Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can I create a temporary variable?
Message
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
00620349
Message ID:
00955406
Views:
29
>The direct answer: Check out SET CONTEXT_INFO in the BOL.
>
>IMO, carry the userid in the app and pass it into all procs. It will make for a much cleaner and obvious solution.
>
>-Mike

Can someone help me with the following syntax?
The convert is not working and returning the same 'context_info' every time regardless of you change the @cUID to!
declare @cUID	VarChar(50)
declare @bUID	binary

set @cUID = '2004102843111235'

set @cUID = convert(varchar,@@SPID) + @cUID
set @bUID = convert(binary, @cUID)

print @cUID

set Context_info @bUID

SELECT context_info
	FROM master.dbo.sysprocesses
	WHERE spid = @@SPID
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform