Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored Procedure using Identity Insert

Status
Not open for further replies.

Nickela

MIS
Oct 22, 2002
29
US
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.

Thanks.

nickela
 
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,

nickela
 
Please post the question on the SQL Server Forum. There are many experienced DBA's that monitor that Forum and will have an answer for your question.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top