I want to call a stored proc with a parameter that contains a string that includes a CRLF.
I am actually calling the SP from an MSAccess Pass Through query. I build the exec statement and it passes it through to SQL in the query
Any ideas?
Malcolm
EDIT: The parameter is to be the body of an email used in the SP.
After “Lester employee:” is a newline.
wit_data_driven_subscription_2parameters 'Invoice', _
'malcolm-smith@bigpond.com', _
'payroll@lester.com.au', _
"Invoice Reprint As Requested", _
"Attached is the invoice reprint you requested for Lester employee:
Jeff Rogers", 'CapturedInvoice', '120744'
TSQL accepts line break characters within string literals… In other words, this is valid:
It depends on how you generate this string in MSAccess… from vba (ms access).. you can build the query like this:
I don’t remember a great deal about access but if you can pass in values using parameters rather than string literals then you avoid this problem, and you avoid plenty of other problems such as SQL injection