在C#中评估sql语句的最佳方式是什么?(What is the best way to evaluate a sql statement in C#?)
评估C#中的SQL语句以确定它是否不仅仅是选择而最好的方法是什么? - 即 - 如果语句稍后执行,则检查值是否会更改(插入,更新,删除,修改或删除)。
任何想法,只要开箱C#dlls /函数我可以使用,或者这是我应该使用字符串解析技术自己编码的东西?
谢谢。
What is the best way to evaluate a SQL statement in C# to determine if it does more than just select? - Ie- check if values would be changed (insert, update, delete, modify, or drop) if the statement was later executed.
Any ideas as far as out of the box C# dlls/functions i can use, or is this something I should code myself using string-parsing techniques?
Thanks.
最满意答案
我会使用数据库权限。 创建一个只有读取访问权限的数据库用户,然后,执行除SELECT之外的任何查询都将失败。
I would use db permissions. Create a database user with read-access only and then, any queries that do anything other than SELECT will fail.
更多推荐
发布评论