Link to home
Start Free TrialLog in
Avatar of golfingmaniac_omaha
golfingmaniac_omaha

asked on

Exec Stored Procedure failed Variable Contains Special Characters

I am trying to execute the following stored procedure.
EXEC [dbo].[usp_TurnoverUpdate] #form.TurnoverID#, '#form.Area#', '#form.begindate#', '#form.enddate#', Active#,  '#form.Description#', '#form.TurnoverText#'

It works as long as #form.turnoverText# doesn't contain any special characters. I need to allow special characters to be passed and inserted into the database ntext field how would i do this?
Avatar of golfingmaniac_omaha
golfingmaniac_omaha

ASKER

I know i can do a find replace on a single quote but is that the only special character that could screw up the process?
Avatar of Anthony Perkins
>>but is that the only special character that could screw up the process?<<
Yes.
pretty sure that sql only looks for single quotes in strings.
ASKER CERTIFIED SOLUTION
Avatar of Melih SARICA
Melih SARICA
Flag of Türkiye image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I think that points must be shared with Acperkins..

He gives the answer. shortly but its an answer 2.


best regards

Melih SARICA
>>I think that points must be shared with Acperkins<<
No problem.
sorry how can i go back and do that?
It is not a big deal.  But if you really want to do it, here are the instructions:

I accepted the wrong answer. Now what?
https://www.experts-exchange.com/Databases/Microsoft_SQL_Server/help.jsp#hi17

And:

Can I split the points?
https://www.experts-exchange.com/Databases/Microsoft_SQL_Server/help.jsp#hi19