How to add literal quote to Stored Procedure

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to add in literal single-quotes around the parameter
@vchDistrictName in the following line. Any suggestions?

SELECT @SQL = @SQL + ' WHERE District.DistrictName = ' + @vchDistrictName
 
Hmm ... the Access reports newsgroup seems an odd choice for this
question!:-) But a quick test indicates that the old double-up-the-quotes
trick may work ...

SELECT '''' + au_lname + '''' AS Expr1
FROM dbo.authors

Those are two sets of four single quotes.

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
Back
Top