views:

28

answers:

0

Hi,

I'm trying to unset an application role but have been failing miserably. I was able to get the cookie value after setting (sp_setapprole) the application role. But I haven't been able to use that cookie (type varbinary / byte array) in my query to unset using sp_unsetapprole.

If it was any other stored procedure it wouldn't have been a problem. I was able to use Command object and create a parameter which takes data type input of adVarBinary (204) and execute the command line.. but to the Server the query goes as below.

exec sp_executesql N'sp_unsetapprole @P1 ',N'@P1 varbinary(36)',0x01000000CD11697F8F0ED3627BC1DAD25FB9CEB3A2EC5B289C658235E510CD9F29230000

Since sp_setapprole and sp_unsetapprole have to be run ad hoc, the sql server is failing to run this line.

And I'm finding it hard to append varbinary cookie value to a simple query such as 'sp_unsetapprole ' & varKookie so it runs "directly" on to the server.

Any kind of suggestions are welcome.

Thanks, Nandagopal