Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 how to insert into a singe quote or comma?

Author  Topic 

davidsong
Starting Member

6 Posts

Posted - 2007-04-12 : 23:33:09
Hi all,
how to insert a long text which contains singe quotes or comma?

thanks a lot
david

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2007-04-12 : 23:50:13
comma shouldn't be a problem.

for single quote, double 'em up

o'reilly becomes o''reilly

insert yourTable (lname)
value ('o''reilly') -- <--- note thats two single quotes, not one double quote
Go to Top of Page

davidsong
Starting Member

6 Posts

Posted - 2007-04-13 : 01:25:22
Thanks a lot!
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-04-13 : 03:36:45
Within a string every single quote should be doubled

Run this and see what it returns

Select '','''','''''',''''''''

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -