如何在SQL中使用一个变量执行存储过程 [英] How to execute STORE PROCEDURE using one Variable in SQL
本文介绍了如何在SQL中使用一个变量执行存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个项目....
所以我需要我们的帮助...
前端使用sql查询,后端也使用存储过程,但仅执行.....
我可以吗....帮帮我......
救救我...救救我...
帮帮我......
I have one project....
So i need urs help...
Frontend using sql query and backend also using store procedure but execution only.....
May i possible this one....Help me......
Help me......Help me......
Help me......
推荐答案
阅读: ^ ]
Am我更正了您要在前端创建查询字符串然后执行此操作的问题.存储过程中输入字符串?
如果是这样,则可以将查询作为参数传递到存储过程中,并将其作为参数传递给sp_executesql.但是,您需要小心,并确保没有用户可以输入非法的sql语句作为输入.阅读有关SQL注入和预防技术的信息:了解SQL注入和创建SQL注入证明ASP.NET应用程序 [ ^ ]
Am I correct that you want to create a query string in front end and then execute this string inside a stored procedure?
If so you can pass the query in as a parameter and inside the stored procedure you would call sp_executesql. You need to be careful though and ensure that no user can enter illegal sql statements as an input. Read up on SQL Injection and prevention techniques: Understanding SQL Injection and Creating SQL Injection Proof ASP.NET Applications[^]
这篇关于如何在SQL中使用一个变量执行存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文