unsetting application role in classic ASP

Posted by user303526 on Stack Overflow See other posts from Stack Overflow or by user303526
Published on 2010-03-28T16:14:57Z Indexed on 2010/03/28 16:23 UTC
Read the original article Hit count: 230

Filed under:
|
|

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

© Stack Overflow or respective owner

Related posts about sql

Related posts about sql-server-2005