Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Triggers and Stored Procedures

Status
Not open for further replies.

agrollma

IS-IT--Management
Sep 29, 2007
1
0
0
US
I need some basic help with getting a trigger and stored procedure working in IDS.

I have a database with category, product, size, primary. I can't force uniqeness, but I can only have one combination of category, product, size, and primary where primary is "Y". I can have multiple Ns. The rows can be populated like:

category product size primary
CAT1 PROD1 SIZE1 Y
CAT1 PROD1 SIZE1 N
CAT1 PROD1 SIZE1 N
CAT2 PROD1 SIZE1 Y
.
.
.
I need to allow users to add and update records, but need to make sure we always only have one record with category, product, size, and primary = Y. Can someone provide an example of a trigger and stored procedure (which is what I think I need to do here) to force this condition?

Thanks in advance,
ag
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top