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
 General SQL Server Forums
 New to SQL Server Programming
 Unclosed quotation mark after the character string

Author  Topic 

rowter
Yak Posting Veteran

76 Posts

Posted - 2009-11-06 : 14:10:34
Hi,

When i use the following statement,
INSERT INTO SCHEDULES(Dest_Desc,) VALUES ('FURR'S CAFETERIA')

I get the following error:
Unclosed quotation mark after the character string ')

How do i correct this?

Thanks in Advance

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2009-11-06 : 14:26:01
It's messing up on the ' in FURR's

try VALUES('FURR''S)

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page

rowter
Yak Posting Veteran

76 Posts

Posted - 2009-11-06 : 14:31:33
It is messing up there but how do i correct it?
On he front end the user will be entering that kind of stuff which has to be populated into the database.
There should be some way to do it

Thanks
Go to Top of Page

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2009-11-06 : 14:51:19
I just showed you how. Are you changing your requirements? I couldn't tell from your post that there was a front-end supplying these values.

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page

rowter
Yak Posting Veteran

76 Posts

Posted - 2009-11-06 : 15:02:08
Hi,

This is not changingthe requirement. This is a new application we are working on.
Normally, what is the procedure for such things?
If there are fields where user enters data which has "'" then how do you save it to the database?

Thanks.
Go to Top of Page

rohitkumar
Constraint Violating Yak Guru

472 Posts

Posted - 2009-11-06 : 15:08:33
read about QUOTENAME

http://msdn.microsoft.com/en-us/library/ms176114.aspx
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-11-09 : 02:26:48
http://sqlblogcasts.com/blogs/madhivanan/archive/2008/02/19/understanding-single-quotes.aspx

Madhivanan

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

- Advertisement -