Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Works in MySQL but not SQL Server
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Database:
Visual FoxPro
Divers
Thread ID:
01431281
Message ID:
01431298
Vues:
57
>I am horsing around with SQL code tonight and thought I'd try some "stuff", but this code didn't work in SQL Server 2005, but does in MySQL:
>
>What did I do wrong? Is it the two single quotes in the word "don't"?
>
>Here's the SELECT statement:
>
>
>use AdventureWorks
>insert into dbo.Album
>(name, track, duration)
>values
>('Abbey Road', 'Don''t Let me Down', 249)
>
MySQL requres you to escape all quotes and a number of other characters. Assuming you are using ODBC, In MySQL the
('Abbey Road', 'Don''t Let me Down', 249)
would be changed by ODBC to:
('Abbey Road', 'Don\'\'t Let me Down', 249)
before the table update.

When I work in PHP directly with MySQL I need to make sure I do that before the update. I do not work my MS SQL but I assume it does not require you to escape the quotes.
Beer is proof that God loves man, and wants him to be happy. - Benjamin Franklin
John J. Henn
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform