Friday, March 23, 2012

little problem..

hey guys, i have a little problem:

i use ASP with MSSQL and i have a query that adds these values to the database:

values(' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ')

when a value is empty, the fields are not filled
but when a value contains a single quote ('), that quote ends the value:

values(' hel'lo ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ')

so my question is, how can i make the quote (') in hel'lo .. invisible or something, so MSSQL wont see it as the end of the value.

(im MYSQL, you can just place a (\) in front of the (') but that doenst work in MSSQL...)use like this :

values(' hel''lo ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ')

-Rohit|||Use one more single quote as the escape character.|||thanx lads! :)

No comments:

Post a Comment