February 6, 2009 at 8:25 am
Hi...I was unable to insert the following value becuase of an apostrophe. How to handle apostrophe in SQL?? Please let me know...
I want to insert the following value into the table :
Example : Insert into table name
Values ( President's Day)
But I am getting the error because of the apostrophe...
Thanks in advance
February 6, 2009 at 8:28 am
Couple of things:
1) When you are inserting string value you need to enclose it in Single Quotes.
2) If the data has single quotes, then you need to replace them with two single quotes. i.e. test'me ==> test''me
Thanks
Vijaya Kadiyala
February 6, 2009 at 8:31 am
Awesome....It worked out....
Thanks a lot
February 6, 2009 at 8:33 am
Hi
I am happy 🙂 to see you got the answer 🙂
Thanks
Vijaya Kadiyala
February 6, 2009 at 9:04 am
...If you are using dynamic SQL, make sure to take care of SQL Injection attacks.
--Ramesh
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply