Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Identity Specification on a ItemID?Identity Specification on a ItemID?
Previous
 
Next
New Post
11/8/2007 3:13 PM
 


 

I have a ItemID column within database, in which I would like to be non-editable & number progressively, in increments of one. (1,2,3,4,5...etc.)
Problem is, I already am using a Primary Key on an "ID" column. When "modifying the table", I cannot seem to find how to make
two columns both be non-editable & number progressively, in increments of one.

Changing Identity Specification to "Yes", takes the Primary off of the "ID" column.
It would be ideal to have the "ItemID" be non-editable, but even if the ItemID column was editable, I need to know how to make it
number progressively, where it will never use the same ItemID twice.

What am I missing? 



Feedback Appreciated,

-machina12

 
New Post
11/8/2007 3:28 PM
 

Someone may come in behind me and correct me, but I do not believe that you can have more than a single Identity column.  I think that this is an intentional limitation of SQL Server.


Will Strohl

Upendo Ventures Upendo Ventures
DNN experts since 2003
Official provider of the Hotcakes Commerce Cloud and SLA support
 
New Post
11/8/2007 4:32 PM
 

Will,

I can see how having multiple Identity Specifications within one SQL table could be conflicting/not possible.  It would be ideal to have the "ItemID" be non-editable, but even if the ItemID column was editable, I need to know how to make it number progressively, where it will never use the same ItemID twice. (1,2,3,4,5,6,7,8,9,10,11......etc.)

What am I missing? 



Feedback Appreciated,

-machina12

 
New Post
11/8/2007 5:03 PM
 

In theory, you could create a trigger that would populate an INT column using the ItemID column.  In addition, you would want to place a UNIQUE constraint on the new column to prevent duplicates from being assigned.  Unfortunately, I am not a good person to write this sample code for you.  You might want to place this question at http://www.sqlteam.com/forums/.  There are some SQL geniuses there!

What will this column be used for?  Why the duplicate data?


Will Strohl

Upendo Ventures Upendo Ventures
DNN experts since 2003
Official provider of the Hotcakes Commerce Cloud and SLA support
 
New Post
11/8/2007 8:20 PM
 

I guess you're right, the ID with Key could be used as ItemID in reality.
Although there are other situations where I need multiple values to stack. Similar to the ModuleID and userID methods.
Thanks for the link.

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Identity Specification on a ItemID?Identity Specification on a ItemID?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out