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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 insert name with a '

Author  Topic 

petek
Posting Yak Master

192 Posts

Posted - 2008-11-10 : 06:54:55
hi all how do i insert the a name like o'neil
into a table, the ' causes a problem

Kind Regards

Pete.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-10 : 06:57:43
use
insert into table (namefield)
values ('o''niel')
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-10 : 06:58:33
see how sql server interprets single quotes

http://sqlblogcasts.com/blogs/madhivanan/archive/2008/02/19/understanding-single-quotes.aspx
Go to Top of Page

petek
Posting Yak Master

192 Posts

Posted - 2008-11-10 : 07:00:32
thanks mate.....

Kind Regards

Pete.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-10 : 07:05:05
Cheers
Go to Top of Page
   

- Advertisement -