August 7, 2013 at 1:48 am
why it is not possible to write following statement
set context_info convert(varbinary(128), 'xyz') as I am considering required parameter as varbinary
August 7, 2013 at 2:25 am
Because the sky is blue.
T-SQL as a programming language is fairly primitive, and far from all commands accepts variables or expression where you want them to.
If you feel that this is important, submit a suggestion on http://connect.microsoft.com/sqlserver/feedback. Don't hold your breath, though.
[font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]
August 7, 2013 at 3:35 am
Thanks! 🙂
as I wanted to write that statement in single statement but I think I have to right multiple statements like
DECLARE @context varbinary(128)
SET @context = CAST('xyz' AS varbinary)
SET CONTEXT_INFO @context
August 7, 2013 at 2:21 pm
Note that it is a little tricky. See this section on my web site:
http://www.sommarskog.se/grantperm.html#context_info. Note that you only need to read down to the next header.
[font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply