限制特定表上的记录数 [英] Limiting no of records on a particular table

查看:68
本文介绍了限制特定表上的记录数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个数据库,但是我面临一种需要根据以下条件进行创建的情况


1)允许零记录
2)允许14条记录
即)记录数不得等于零或14


如何创建这样的数据库
在此先感谢

i have created a database but i am facing a situation where i need to create based on the following condition


1) zero records allowed
2) 14 records allowed
ie) no of records has to be equal to zero or 14


how to create such a database
thanks in advance

推荐答案

创建一个INSTEAD OF INSERT触发器,如果​​INSERTED表中的记录数等于14,则仅执行INSERTION.

请参阅 http://msdn.microsoft.com/en-us/library/ms175089.aspx [ ^ ],以获取有关此触发器的更多信息
Create an INSTEAD OF INSERT trigger, if the number of records in the INSERTED table is equal to 14 then only do the INSERTION.

See http://msdn.microsoft.com/en-us/library/ms175089.aspx[^] for more information about this trigger


我不明白你的意思,我想知道.
i am not getting you, what you trying to say, i need to know.


这篇关于限制特定表上的记录数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆