|
-
Feb 28th, 2007, 03:16 PM
#1
Thread Starter
Fanatic Member
Some way around this?
I have a stored procedure that is called by users with DataReader and DataWriter rights. This stored procedure is used in the monthly closing for this company. It removes all of the records from the PaidOuts table and then needs to reset the Identity Seed to 0.
When we went live I used:
Code:
DBCC CHECKIDENT ('PaidOuts', RESEED , 0)
However, that gave an error stating that the user did not have enough permissions on the table.
I then changed the code to:
Code:
TRUNCATE TABLE PaidOuts
This, too, gave me the same message. What permissions would be needed to execute one of these statements?
Is there any way to have a DataReader/DataWriter user reset the Identity seed for a table?
My.Settings.Signature = String.Empty
-
Mar 1st, 2007, 05:07 AM
#2
Re: Some way around this?
"The dark side clouds everything. Impossible to see the future is."
-
Mar 1st, 2007, 08:05 AM
#3
Re: Some way around this?
sa is sql authentication - you should not even be using sql authentication...
At any rate - what PERMISSIONS have you GRANTED to the SPROC that does this?
-
Mar 1st, 2007, 08:49 AM
#4
Thread Starter
Fanatic Member
Re: Some way around this?
I have granted Domain Users (this is a very small office) DataReader and DataWriter rights to the applications. And that group has Execute permissions on the SP.
My.Settings.Signature = String.Empty
-
Mar 1st, 2007, 10:05 AM
#5
Re: Some way around this?
Books Online shows the permissions needed for CheckIdent
Permissions
DBCC CHECKIDENT permissions default to the table owner, members of the sysadmin fixed server role, and the db_owner and db_ddladmin fixed database role, and are not transferable.
Seems to be the same for TRUNCATE - interesting...
Permissions
TRUNCATE TABLE permissions default to the table owner, members of the sysadmin fixed server role, and the db_owner and db_ddladmin fixed database roles, and are not transferable.
-
Mar 1st, 2007, 10:09 AM
#6
Thread Starter
Fanatic Member
Re: Some way around this?
Any other thoughts on resetting the Identity for this table? This is a table that holds information about Petty Cash pay outs. There really aren't that many during each month. They just like to see the reference number incremented starting at 1.
I could create another column in the table that is just a Count() + 1.
My.Settings.Signature = String.Empty
-
Mar 1st, 2007, 10:11 AM
#7
Re: Some way around this?
Are you against giving one of those permissions to the users who might run this option? Like the DB_DDLADMIN role?
-
Mar 1st, 2007, 10:17 AM
#8
Thread Starter
Fanatic Member
Re: Some way around this?
Well... I currently just use the Domain Users account. I could just assign Domain Users to the DB_DDLADMIN role. I don't see much harm in that.
My.Settings.Signature = String.Empty
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|