问题描述
如何使用存储过程更新sql数据库表记录.
条件-
1.将数据库名称作为参数传递
2.通过表更新,其中条件作为参数
提前谢谢!
请尽快帮助我
how to update sql database table record using stored procedure.
Condition-
1.pass database name as a parameter
2.pass the table update where condition as a parameter
Thanks in advance!
Please help me as soon as possible
推荐答案
create procedure UpdateWhatever (@Param1 int, @Param2 nvarchar(50))
as
update table foo
set Col1 = @Param2
where Col2 = @param1
go
您的程序将使用您认为合适的任何方法将所需的参数传递给存储过程:再次进行研究:我不知道您是使用ADO还是EF还是很难说应该如何传递数据. />
ps:永远不要说尽快"或"plz hlp":只会惹恼别人.
your program would pass the required parameters to the stored procedure using whatever method you deemed appropriate: again, do your research: I have no idea if you are using ADO or EF or whatever so hard to say how you should pass the data.
ps: Never say ''as soon as possible'' or ''plz hlp'': just pisses people off.
这篇关于sql database 2008 pass db参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!