GameboyRMH
GameboyRMH GRM+ Memberand SuperDork
4/16/09 8:48 a.m.

In MySQL things were simple - got a nasty character, put a backslash in front of it, the simple and straightforward standard method of escaping characters. MSSQL on the other hand, being an utter bitch and proprietary piece of total E36 M3, seems to have a different method of escaping each troublesome character. I've figured them all out except the double quote. "" can go into a query but it still comes back out as "". This seems to be the greatest MSSQL mystery of them all. Using the ESCAPE command isn't an option - the queries have to be compatible with other, decent database servers and I've already had to do heavy modifications to the app to make it work with MSSQL.

Also if you can tell me why newline characters - backslash r backslash n - are actually showing in the output instead of a newline, that would be nice too.

My deepest sympathies if you need to work with this thing on a regular basis.

I have to hurry up and finish this thing so that I can then write another app to translate database queries from real SQL to TSQL >:(

EDIT: D'oh figured it out, you don't escape them at all.

Dr. Hess
Dr. Hess SuperDork
4/16/09 9:37 a.m.

Well, that was easy. Yeah, a single quote is the official 'this is a string.' A double quote is just another character, like W or O.

My biggest complaint is that SQL Server won't run on anything but the Windoze Server OS. Not XP, 2K, etc. I don't like the way MS changes stuff just to be different either, and not just in SQL, but in C too. But, it keeps the Lotus parts coming, so WTF.

fiat22turbo
fiat22turbo GRM+ Memberand SuperDork
4/16/09 9:53 a.m.

Virtual Machines are your friend. Pop just built a Quad-core AMD box to do SQL 08 & W2K8 training at home. He's using Proxmox as a base, seems to be working well so far.

scardeal
scardeal New Reader
4/16/09 10:30 a.m.

I've got SQL server 2005 running on Vista...

You'll need to log in to post.

Our Preferred Partners
5OSFZBk7k5RNAPFhbmeYfkGBRMd3YrisT4nS1zoY5iTltIIXgx2ZzqQRbpRCCgsP