c3118526 Posted April 22, 2007 Share Posted April 22, 2007 I have a transaction table where transaction id (primary key), membership#, and dates are kept. I want to make it so that there can be at most 5 transaction id for each membership# Link to comment Share on other sites More sharing options...
pulpfiction Posted April 23, 2007 Share Posted April 23, 2007 Not sure if you can do that in SQL. You must do that restriction with application... Link to comment Share on other sites More sharing options...
nibe49 Posted April 23, 2007 Share Posted April 23, 2007 Hi RyanaldoIn principle you can use a trigger that fires on a table insert. The trigger would need to carry out some action depending on a count of ids in the table. Triggers are a bit variable in syntax from 1 SQL vendor/product to another so I hesitate to write any code.The question to ask is what you want to do when transaction 6 comes along, you probably should not just ignore it.I think I would agree with pulpfiction that this is better controlled in the calling application.regardsnibe Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now