Computing.Net > Forums > Programming > SQL help?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

SQL help?

Reply to Message Icon

Name: Anders
Date: May 14, 2003 at 14:37:21 Pacific
OS: xp
CPU/Ram: 256
Comment:

Lets say I have 2 tabels. tbl_Customer and tbl_Profile. I have a PK called cust_ID and a FK in tbl_profile called cust_IDRef. A customer may noly have 3 Profiles, if he tries to add another profile he is not allowed.

Hmmm, hope you understood it.

How do I do this???
Thx in advance...



Sponsored Link
Ads by Google

Response Number 1
Name: Don Arnett
Date: May 15, 2003 at 16:44:42 Pacific
Reply:

I don't think that you can do this (prevent a forth profile being added) strictly thru SQL.

You'd have to write a script or program (maybe a trigger or stored procedure) that checks the number of existing profiles before adding a new profile.


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: SQL help?

SQL Help www.computing.net/answers/programming/sql-help/6312.html

SQL Help! www.computing.net/answers/programming/sql-help/10974.html

SQL help plesae www.computing.net/answers/programming/sql-help-plesae/12325.html