Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Identity Insert Permissions Issue

Author  Topic 

schuhtl
Posting Yak Master

102 Posts

Posted - 2006-07-13 : 12:01:15
I have two tables that are almost identical except one of the tables (tableA) has an identity column and tableB has the value of the identify column (not an actual identity column). tableB is an archive table and I am looking to create a procedure to move an archived record from tableB back to tableA and keep the original identity value. This procedure will be called from multiple users who have very low db privileges. We have created something that works however the user that calls the procedure needs to have ddl_admin, dbo or sysadmin privileges to exec SET IDENTITY_INSERT which I really do not want to do. Can anyone think of a way around this?

nr
SQLTeam MVY

12543 Posts

Posted - 2006-07-13 : 12:04:07
Create a table to hold the command - it just needs the pk of the row to be moved back.
The user places an entry in that table to move the row.
Create a job which looks at the table and actions the command.

There will be a slight delay (up to a minute if you just leave the scheduler to run the job every minute).

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

schuhtl
Posting Yak Master

102 Posts

Posted - 2006-07-13 : 12:25:20
nr,

We thought of that as well and I think that is the route that we will have to take. Thanks!
Go to Top of Page
   

- Advertisement -