通过GUI手动拒绝数据插入 [英] Deny Data Insertion manually through GUI

查看:53
本文介绍了通过GUI手动拒绝数据插入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个MS SQL SERVER 2005表,其中包含4列Col1,Col2,Col3和Col4.如果Col2和Col3为NULL,则Col4应拒绝通过GUI手动插入的数据,这意味着没有查询可用于插入/更新. 该工作是通过GUI手动完成的.否则,如果Col2和Col3不为NULL,则Col4可以接受数据.我不需要存储过程或触发器来完成此操作.

I have a MS SQL SERVER 2005 table with 4 columns, Col1, Col2, Col3 and Col4. If Col2 and Col3 are NULL, then Col4 should deny data that is inserted manually through GUI, which means no query is used either to Insert/Update. The work is done manually through GUI. Else if Col2 and Col3 are NOT NULL, then Col4 can accept data. I don''t require Stored Procedures or Triggers to have this done.

推荐答案

您不需要SP或触发器即可实现此目的,您可以使用IF条件或案例 [中的target =" _ blank"title =" New Window> ^ ]

就像
You don''t need a SP or a Trigger to achieve this, you can either use IF conditions or CASE[^] in your inline query

like
UPDATE TABLE1 SET COL4 = CASE COL1 IS NULL AND COL2 IS NULL THEN NULL ELSE 'New Value' END


如果您不需要SP或触发器,那么您要么必须将其作为完整的查询提交-效率低下,而且本来应该与SP相同的代码,或者最好在GUI应用程序中进行.

由于您不告诉使用的语言,平台等,因此我们无法为您提供帮助.
If you don''t want an SP or a Trigger, then you either have to submit it as a complete query - inefficient, and the same code as a SP would have been, or better do it in the GUI application.

Since you don''t tell use what language, platform etc, you are using, we can''t help you.


这篇关于通过GUI手动拒绝数据插入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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