没有存储过程的参数化查询?
我见过的每个示例都使用存储过程。 我采用了一个用经典 ASP 编写的旧应用程序,该应用程序使用内联 SQL。 这是一个明显的问题,所以我需要将其转换为更安全的代码。 客户端不希望我在此应用程序中使用存储过程,那么有没有办法在没有存储过程的情况下运行参数化查询?
谢谢
Every sample I've seen uses stored procedures. I've adopted an old application written in Classic ASP that uses inline SQL. This is an obvious issue, so I need to convert it to safer code. The client does not wish that I use stored procedures in this application, so is there a way to run parameterized queries without stored procedures?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
就在这里。 看一下其中一些示例:
http ://www.securestate.blogspot.com/2008/09/classic-asp-sql-injection-prevention_30.html
http://www.userFriendlythinking.com/博客/BlogDetail.asp?p1=7013&p2=119&p7=3001
Yes, there is. Have a look at some of these examples:
http://www.securestate.blogspot.com/2008/09/classic-asp-sql-injection-prevention_30.html
http://www.userfriendlythinking.com/Blog/BlogDetail.asp?p1=7013&p2=119&p7=3001
客户端有什么理由不想使用存储过程吗? 在数据库级别以及源代码中使用存储过程要容易得多。 如果您使用上面的第二种方法,您应该在内联查询上获得查询计划缓存,但根据您正在做的事情,如果您可以说服您的客户可以使用它们,那么使用简单的存储过程可能会更好。 如果其他一切都失败了,上面的链接非常可靠,尤其是第二个。
Is there any reason why the client doesn't want to use stored procedures? It is much easier to use stored procedures both on the database level as well as in your source code. You should get query plan caching on your inline query if you use the second method from above, but depending on what you are doing you might be better off with simple sprocs if you can convince your client that it's ok to use them. If all else fails the links above are pretty solid, especially the second one.