询问者
How can i limit the total number of rows to add in the SQL 2008 table

问题
-
Can any one please tell me that how can i limit the max number of rows to be insert into the sql table
if the user try to insert the rows out of the max limit then
how to delete old rows from the table so that use can insert rows in the table
Like if i want to insert use last 100 transaction record in a table
but if user try to add 101 number of transaction then how to let him allow to insert and delete top one row order by tid asc
全部回复
-
If your question is in CRM developing, then you can develop a plugin to catch Create message on prestage to determine the total records count. If the number is greater than the limit, throw exception.
or if your question is in sql script query, just a write a trigger on the table
daemon lin -
Hi, Can you please help me to understand why are you having this requirement? Are you trying to limit that number of records that a user allow to create? CRM doesn't have that out of the box. Modifying the SQL table is not a support approach.
If they need to do it through the application, there are other ways to accomplish this requirement.
Darren Liu (MSFT) | 刘嘉鸿 | Blog: http://blogs.msdn.com/b/darrenliu/