Valhalla Legends Forums Archive | General Programming | Moveing from MySQL to MSSQL.

AuthorMessageTime
dRAgoN
Whats the best way to go around this without haveing to make mass edits to all the query strings EG:.
[code]        '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) & ")"[/code]
September 30, 2006, 11:35 PM
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.
October 1, 2006, 12:53 AM
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.
October 1, 2006, 4:04 PM
Myndfyr
[quote author=l)ragon link=topic=15813.msg159262#msg159262 date=1159659354]
Whats the best way to go around this without haveing to make mass edits to all the query strings EG:.
[code]        '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.[/code]
October 6, 2006, 8:07 PM
dRAgoN
[quote author=MyndFyre[vL] link=topic=15813.msg159508#msg159508 date=1160165228]
[quote author=l)ragon link=topic=15813.msg159262#msg159262 date=1159659354]
Whats the best way to go around this without haveing to make mass edits to all the query strings EG:.
[code]        '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.[/code]
[/quote]
That works so does the other line, I'm just rewriteing all my lines.
October 7, 2006, 12:01 AM

Search