SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Passing Parameters to Stored procedure
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

vijays3
Constraint Violating Yak Guru

India
343 Posts

Posted - 02/14/2013 :  08:49:57  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

3639 Posts

Posted - 02/14/2013 :  08:52:37  Show Profile  Reply with Quote
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

India
343 Posts

Posted - 02/18/2013 :  06:55:57  Show Profile  Reply with Quote
Thanks it is working fine.

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

James K
Flowing Fount of Yak Knowledge

3639 Posts

Posted - 02/18/2013 :  07:57:30  Show Profile  Reply with Quote
You are welcome - glad to help.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.04 seconds. Powered By: Snitz Forums 2000