Hello everybody,
I have some stored procedure that move records from a production tables to archive tables and they SET IDENTITY_INSERT ON for the insert and then turn it off afterwards. The procedures do exactly what I am wanting them to do.
My issue is that I would like some of the users to be able to execute this procedure from a form, but the users get an error message because they aren't in the server role that allows them to use the SET command. Is there anyway to execute the stored procedure without assigning the dbowner server role to the user? I would like to pass it as a parameter or temporarily assign this to a user if possible.
Does anyone know of a "Run As" type of command that I would be able to use preceding or during the call to the stored procedure in the VBA so that the user that clicked on the button would be assigned the dbowner server role for the running of the stored procedure, but would then be back at their normal role after the stored procedure completed?
Thanks for the help.
Nickela
I have some stored procedure that move records from a production tables to archive tables and they SET IDENTITY_INSERT ON for the insert and then turn it off afterwards. The procedures do exactly what I am wanting them to do.
My issue is that I would like some of the users to be able to execute this procedure from a form, but the users get an error message because they aren't in the server role that allows them to use the SET command. Is there anyway to execute the stored procedure without assigning the dbowner server role to the user? I would like to pass it as a parameter or temporarily assign this to a user if possible.
Does anyone know of a "Run As" type of command that I would be able to use preceding or during the call to the stored procedure in the VBA so that the user that clicked on the button would be assigned the dbowner server role for the running of the stored procedure, but would then be back at their normal role after the stored procedure completed?
Thanks for the help.
Nickela