• Welcome to Valhalla Legends Archive.
 

Moveing from MySQL to MSSQL.

Started by l)ragon, September 30, 2006, 06:35 PM

Previous topic - Next topic

l)ragon

Whats the best way to go around this without haveing to make mass edits to all the query strings EG:.
        'MySQL
        'sqlCRQuery = "INSERT INTO " & db_item_Header & "(" & db_item_PageID & ", " & db_item_PageText & ", " & db_item_NextPage & ", " & db_item_WDBVersion & ", " & db_item_Checksum & ") VALUES (""" & PageID & """, """ & TestFixString(PageText) & """, """ & NextPageID & """, """ & WDBVersion & """, """ & CLng(CheckSum) & """)"
        'MS-SQL
        sqlCRQuery = "INSERT INTO " & db_item_Header & "(" & db_item_PageID & ", " & db_item_PageText & ", " & db_item_NextPage & ", " & db_item_WDBVersion & ", " & db_item_Checksum & ") VALUES (" & PageID & ", '""" & TestFixString(PageText) & """', " & NextPageID & ", " & WDBVersion & ", " & CLng(CheckSum) & ")"
*^~·.,¸¸,.·´¯`·.,¸¸,.-·~^*ˆ¨¯¯¨ˆ*^~·.,l)ragon,.-·~^*ˆ¨¯¯¨ˆ*^~·.,¸¸,.·´¯`·.,¸¸,.-·~^*

rabbit

God VB is ugly..

Anyway, MySQL and MSSQL have almost exactly the same usage, it's just the inside bits that are substantially different.
Grif: Yeah, and the people in the red states are mad because the people in the blue states are mean to them and want them to pay money for roads and schools instead of cool things like NASCAR and shotguns.  Also, there's something about ketchup in there.

Kp

Is it really so bad to make mass edits to the query strings?  If your transforms are reasonably consistent, one could write a sed or awk script to do it pretty easily.  Sed would probably be a better choice here, since it's a stream editor.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

MyndFyre

Quote from: l)ragon on September 30, 2006, 06:35 PM
Whats the best way to go around this without haveing to make mass edits to all the query strings EG:.
        'MySQL
        'sqlCRQuery = "INSERT INTO " & db_item_Header & "(" & db_item_PageID & ", " & db_item_PageText & ", " & db_item_NextPage & ", " & db_item_WDBVersion & ", " & db_item_Checksum & ") VALUES (""" & PageID & """, """ & TestFixString(PageText) & """, """ & NextPageID & """, """ & WDBVersion & """, """ & CLng(CheckSum) & """)"
[/quote]
Looks like MySQL was broken.  IIRC, you're not supposed to have quotes around numeric values in ANSI SQL.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

l)ragon

Quote from: MyndFyre[vL] on October 06, 2006, 03:07 PM
Quote from: l)ragon on September 30, 2006, 06:35 PM
Whats the best way to go around this without haveing to make mass edits to all the query strings EG:.
        'MySQL
        'sqlCRQuery = "INSERT INTO " & db_item_Header & "(" & db_item_PageID & ", " & db_item_PageText & ", " & db_item_NextPage & ", " & db_item_WDBVersion & ", " & db_item_Checksum & ") VALUES (""" & PageID & """, """ & TestFixString(PageText) & """, """ & NextPageID & """, """ & WDBVersion & """, """ & CLng(CheckSum) & """)"
[/quote]
Looks like MySQL was broken.  IIRC, you're not supposed to have quotes around numeric values in ANSI SQL.

That works so does the other line, I'm just rewriteing all my lines.
*^~·.,¸¸,.·´¯`·.,¸¸,.-·~^*ˆ¨¯¯¨ˆ*^~·.,l)ragon,.-·~^*ˆ¨¯¯¨ˆ*^~·.,¸¸,.·´¯`·.,¸¸,.-·~^*