Print Page | Close Window

Identity column keys require dbcc privileges

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2700
Printed Date: 28-Mar-2024 at 9:03am


Topic: Identity column keys require dbcc privileges
Posted By: aschaff
Subject: Identity column keys require dbcc privileges
Date 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?



Replies:
Posted By: kimj
Date 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. 

 
 


Posted By: aschaff
Date 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.




Posted By: kimj
Date 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.  :)



Print Page | Close Window