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)
 Unclosed quotation mark after the character string

Author  Topic 

DirectMovie
Starting Member

1 Post

Posted - 2007-03-03 : 11:19:19
Hello everybody,

I'm looking to the following error all day now, and it is driving me crasy. I can't seam to get ride of it :(. The error I get is:
Unclosed quotation mark after the character string ', 500, 0, 0, 0, CURRENT_TIMESTAMP)'

It looks like I forgot to close a quote or something, but I searched and searched and searched and then I searched again, but I can't find which char I forget to escape :(. Or is it something else I'm doing wrong? I don't have that much experience with SQL Server 2005. This is the query I try to run (The texts I try to insert are dutch btw):
INSERT INTO film (id, naam, regisseur, drmurl2, drmurl1, genre1, land, prijs, actief, top10_aktueel, top10, omschrijving, taal, speelduur, jaar, drmtrailurl, contentprov, beeldformaat, subgenre1, subgenre2, subgenre3, genre2, genre3, aanbevolen, aktie_actief, credits, min_leeftijd, percen_kostprijs, drmurl3, kosten_streaming, hosting_kosten, kosten_betaalmethode, drmurl4, movie_rank, waardering, aantal_waarderingen, bedrag_leverancier, laatst_bewerkt) VALUES (39, 'Devil\'s Prey', 'Bradford May ', '39\_1000.wmv', '39\_1500.wmv', 'horror', 'Verenigde Staten', 1.99, 1, 0, 0, 'Tijdens een kinky rave party breekt een vechtpartij uit en vijf vrienden worden eruit gezet. Terug in de auto vragen ze zich af hoe het zo uit de hand heeft kunnen lopen als ze een jonge vrouw \‘Fawn\’ omverrijden. Ze blijkt gekleed in bebloede vodden en', 'Engels \(VS\)', 90, 2001, '39\_trailer.wmv', '113645', 'breedbeeld', '0', ' ', ' ', '0', '0', 1, 0, 199, '16 jaar', 40, '39\_600.wmv', 35, 0, 42, '39\_1500.wmv', 500, 0, 0, 0, CURRENT_TIMESTAMP)

What the hell is going wrong? After a day of looking at this error I would realy, realy, realy like it do disappear ;)

Best regards,
DirectMovie

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-03-03 : 11:43:23
The error lies here:

'Devil\'s Prey'


Whenever your data contains quote character, escape it with another quote character like this:

'Devil\''s Prey'


to avoid the error.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2007-03-03 : 11:55:55
I think you are assuming that you escape things in T-SQL with the \ character, which is incorrect. To escape a single quote, as mentioned, you double them up. Chances are you want to remove many of the \ characters in your T-SQL statement.

Never just assume programming language X works the same as programming language Y; always check the documentation to be sure.

- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page
   

- Advertisement -