Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Limiting records

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-03-30 : 09:22:17
Suzanne writes "I have a database where people will be able to enroll in classes and I would like to limit the number of enrollees per class (or records with specific column values), how can this be done?

SQL Server 2000
Windows Server 2003


Thank you!"

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-03-30 : 09:25:21
Something like

If (select count(*) from table)>somevalue
--Dont insert data
else
--Insert data

Otherwise give more details



Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -