Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

why it is not possible to execute this way set context_info convert(varbinary(128), 'xyz') Expand / Collapse
Author
Message
Posted Wednesday, August 7, 2013 1:48 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Sunday, November 2, 2014 9:45 PM
Points: 12, Visits: 53
why it is not possible to write following statement

set context_info convert(varbinary(128), 'xyz') as I am considering required parameter as varbinary
Post #1481697
Posted Wednesday, August 7, 2013 2:25 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Friday, December 12, 2014 1:02 AM
Points: 823, Visits: 753
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.


Erland Sommarskog, SQL Server MVP, www.sommarskog.se
Post #1481712
Posted Wednesday, August 7, 2013 3:35 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Sunday, November 2, 2014 9:45 PM
Points: 12, Visits: 53
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


Post #1481760
Posted Wednesday, August 7, 2013 2:21 PM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Friday, December 12, 2014 1:02 AM
Points: 823, Visits: 753
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.


Erland Sommarskog, SQL Server MVP, www.sommarskog.se
Post #1482055
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse