如何将单引号文本作为参数传递给sqlserver中的存储过程[duplicate]

时间:2022-03-27 08:47:12

This question already has an answer here:

这个问题已经有了答案:

How to pass "Ram's" or "I'm xxx" type of single quote data as parameter to the stored procedure?

如何将单引号数据的“Ram”或“I’m xxx”类型作为参数传递给存储过程?

2 个解决方案

#1


3  

You can call the stored proc like this

可以这样调用存储的proc

exec stored_proc_name @param_name='Ram''s'

#2


2  

You need to escape the quote by another quote

你需要用另一句引用来逃避引用。

'Ram''s'

#1


3  

You can call the stored proc like this

可以这样调用存储的proc

exec stored_proc_name @param_name='Ram''s'

#2


2  

You need to escape the quote by another quote

你需要用另一句引用来逃避引用。

'Ram''s'