none
How can i limit the total number of rows to add in the SQL 2008 table RRS feed

  • 问题

  • 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
    2011年9月30日 6:13

全部回复

  • 写Plugin,在PreCreate中判断当前插入的实体的记录数量。


    daemon lin
    2011年9月30日 7:26
  • I don't understand Your Language sir 
    please reply it in English. 
    Tushar Tyagi
    2011年9月30日 9:50
  • 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
    2011年10月10日 15:36
  • 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/
    2011年11月2日 23:42
    版主