New Posts New Posts RSS Feed: Identity column keys require dbcc privileges
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Identity column keys require dbcc privileges

 Post Reply Post Reply
Author
aschaff View Drop Down
Newbie
Newbie
Avatar

Joined: 28-May-2009
Posts: 13
Post Options Post Options   Quote aschaff Quote  Post ReplyReply Direct Link To This Post Topic: Identity column keys require dbcc privileges
    Posted: 19-May-2011 at 4:21pm
I have noticed that if I create a DevForce entity from a table with a SQL identity column as primary key, it seems that DevForce issues DBCC CHECKIDENT commands. This is causing permission issues for users who do not have DBCC permissions. What options do I have to get around this?
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 20-May-2011 at 9:34am

By default DevForce does use DBCC CheckIdent when working with Identity keys.  You can instead use a DevForce-supplied stored procedure to handle Identity keys - this requires installing the stored procedure and settting an option in the config file.  You can find a step-by-step description of how to set this up in the "Sql Server Identity Id Generation" section of the Developer's Guide.

I should add that you do have another option for key generation.   A common means of handling Id generation in DevForce Classic is to implement an IIdGenerator.  This may sound harder than it is, since you can generally use the "NumericIdGenerator" class found in many of the learning units as is. 

 
 
Back to Top
aschaff View Drop Down
Newbie
Newbie
Avatar

Joined: 28-May-2009
Posts: 13
Post Options Post Options   Quote aschaff Quote  Post ReplyReply Direct Link To This Post Posted: 20-May-2011 at 11:56am
Thanks for the info. I see that it doesn't work with SQL2000, which we still have some customers on.

As for generating an ID via DevForce, I'm afraid that wouldn't work. I have (a) existing rows in the database that would need a value, and (b) other existing applications that I can't modify which create rows in the table. Adding an identity column solves both (a) and (b) but not non-admin sql users on SQL2000.

I guess I'm just out of luck.


Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 20-May-2011 at 12:20pm
Well on the bright side, per your other thread, you've still got the "SortOrder" to work with, and that shouldn't require too much change to your code.  :)
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down