Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Passing Parameters to Stored procedure

Author  Topic 

vijays3
Constraint Violating Yak Guru

354 Posts

Posted - 2013-02-14 : 08:49:57
Hi

I am trying to pass parameter to stored procedure but it causing issue my passing string is already having comma (') in it because of this cant pass the parameter. My values is Price 'n Pride South Africa this has comma (') its causing prob.Please let me know solution



Exec [dbo].[Usp_MoodleQuizReport] 'FS SAP Financial Services Consultant Assessment','Price 'n Pride South Africa' ,1



Vijay is here to learn something from you guys.

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-02-14 : 08:52:37
Did you mean it has single quote? You can escape a single quote with another single quote. So
Exec [dbo].[Usp_MoodleQuizReport] 
'FS SAP Financial Services Consultant Assessment',
'Price ''n Pride South Africa',
1
Go to Top of Page

vijays3
Constraint Violating Yak Guru

354 Posts

Posted - 2013-02-18 : 06:55:57
Thanks it is working fine.

Vijay is here to learn something from you guys.
Go to Top of Page

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-02-18 : 07:57:30
You are welcome - glad to help.
Go to Top of Page
   

- Advertisement -