How to auto-generate a unique ID in the Item table?

Oct 04, 2006 2 Replies

I want to auto-generate a unique ID in the Item table when a new item is created. How can I do this with MSDE SQL Server? By using SQL triggers or setting the Item ID field as auto-generate? However, if I change the Item ID field will those changes be blown away when MSDE is upgraded?



Thanks, Poppy


item table already has an identity field (Item.ID) that is auto generated and unique, so what is the problem u have?

You are asking about the LookupCode, correct?

If so, then yes you can do it with a trigger, and yes it will be blown away if MS ever alters the Item table in an update. If you do this, make sure you keep a copy of the create script for your trigger. Also make sure you test thoroughly on a non production database!

There are existing add-ins that already provide this - ask your reseller or check out Digital Retail Solutions and Retail Realm. There are probably more add-ins out there that include this, but I know both of those have them...

Glenn Adams Tiber Creek C> I want to auto-generate a unique ID in the Item table when a new item is

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required