in

Community Server

The platform that enables you to build rich, interactive communities

Convert SQL to MySQL

Last post 05-05-2012 3:53 AM by haresdehan. 18 replies.
Page 1 of 2 (19 items) 1 2 Next >
Sort Posts: Previous Next
  • 08-16-2011 11:59 AM

    Convert SQL to MySQL

    Just in case there are any MySQL wizards out there... I am working on my understanding of the differences between SQL/MySQL. I need help with this line to get me started:

    sql = "SELECT MAX([DateTime]) AS LastDay FROM Schedule"

    this works as a SQL statement, but MySqL gives the following error:
    [MySQL][ODBC 5.1 Driver][mysqld-5.5.9]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[DateTime]) AS LastDay FROM Schedule' at line 1
    /pool.sql/Default.asp, line 111

    I will post more info here as I have time to sort through stuff
    Anyone curious, to get MySQL started, I converted the connection string in config.asp to read:
    const DATABASE_CONNECTION_STRING ="Driver={MySQL ODBC 5.1 Driver};Server=serveraddress;Database=databasename; User=databaseuser;Password=databasepassword;Option=3;"

    Using that line, i was able to get the login page working - It can read/use the username/password tables from the mysql database. I simply imported the access nfl.mdb file into MySQL (I used Access-MySQL for this - http://www.bullzip.com/products/a2m/info.php)
  • 08-16-2011 1:35 PM In reply to

    • BildoAz
    • Top 25 Contributor
    • Joined on 08-12-2011
    • Chandler, Az.
    • Posts 36

    Re: Convert SQL to MySQL

    Did you try MAX(Schedule.[DateTime]) I know MySQL can get pretty language strict. Especially when it comes to naming tables in the query.
  • 08-16-2011 1:47 PM In reply to

    Re: Convert SQL to MySQL

    I am still trying to read up on how the table queries work... I just tried replacing my line from:
    sql = "SELECT MAX([DateTime]) AS LastDay FROM Schedule"
    to:
    sql = "SELECT MAX(Schedule.[DateTime]) AS LastDay"
    Same Error...
    "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[DateTime]) AS LastDay' at line 1"
  • 08-16-2011 2:01 PM In reply to

    • BildoAz
    • Top 25 Contributor
    • Joined on 08-12-2011
    • Chandler, Az.
    • Posts 36

    Re: Convert SQL to MySQL

    So do you have a modified Schedule Table? I see in Mike's he has 'Date' and 'Time' are you combining the two fields?
  • 08-16-2011 2:10 PM In reply to

    Re: Convert SQL to MySQL

    They still exist as 2 separate columns in my database, not sure why they are being joined... Basically all I have done is taken the code someone else posted for the SQL database, and I am trying to convert that code to MySQL. Now that I have looked at MIke's original default.asp file, I see the select Max line only asks for Date, and NOT time. I don't know why they were merged into 1 line for the SQL code.
    thanks BildoAz - I think this may nudge me in the direction I need!
  • 08-16-2011 2:14 PM In reply to

    • BildoAz
    • Top 25 Contributor
    • Joined on 08-12-2011
    • Chandler, Az.
    • Posts 36

    Re: Convert SQL to MySQL

    Anytime. Keep me posted! I'm in the process of changing my modified data into SQL Server. So I'm interested.
  • 08-18-2011 4:10 PM In reply to

    Re: Convert SQL to MySQL

     ck,  I combined the Date and Time columns into just a Date column.  I then changed [DateTime] in the code to (Date).  I got as far as I did before.  I am just working on getting the survivor pool part working.  I am able to enter my survivor pick and it displays the survivor pool status.  But when I go back to either change my pick or enter a pick for another week, there are no Radio buttons to select a team.  I have the Delete, Update button, Alive status.  Just no way to select a team.

  • 08-19-2011 7:00 AM In reply to

    Re: Convert SQL to MySQL

     ck,  I found out why my radio buttons are not showing up.  It was mentioned somewhere on here but the Survivorstatus table in Access has  Boolean data types, MySQL does not.  So in sideentry.asp I had to add some code to convert 0 to false and 1 to true.  I am sure there is more to change somewhere, but I am getting closer.

  • 08-25-2011 7:43 AM In reply to

    Re: Convert SQL to MySQL

     cklemm,  I worked through a few more issues.  My current problem is with the accountbalance.asp page under the admin menu.  It does not show any amounts, all 0's.  Even though the individual accountsummary page for users shows credits and balances.   I am thinking that it is acting like the problem I had with no radio buttons showing up.  There is a boolean field somewhere that mysql can't handle.

  • 09-24-2011 1:26 PM In reply to

    • todhend
    • Top 25 Contributor
    • Joined on 09-14-2009
    • Missouri
    • Posts 46

    Re: Convert SQL to MySQL

     you may be having some of the same issues as the windows sql script change, try changing all the true and false to 1 or 0  

  • 11-10-2011 11:54 PM In reply to

    Re: Convert SQL to MySQL

    Converting SQL to MySQL Loader is a tool which provides user friendly interface to manage repository..such as taking backup from previous backup and even can create new blank repository. To run transfer jobs at specified intervals it comes with a built in scheduler.

     


    Managed Hosting

  • 12-21-2011 10:03 PM In reply to

    • mathewcrony
    • Top 150 Contributor
    • Joined on 12-22-2011
    • Channing St NW Washington, DC
    • Posts 1

    Re: Convert SQL to MySQL

    Few benefits of MySQL over SQL DataBase are listed below:

    Inexpensive , Customizable , easy to learn and Data recovery support.

     

    vpn

  • 01-08-2012 11:04 AM In reply to

    Re: Convert SQL to MySQL

     Isn't MySQL unstable? In terms of data management, I mean. Does anyone know how to make it stable so that many servers can access the data at once? Is there some sort of ediscovery that can be done? 

    Filed under:
  • 02-07-2012 11:26 PM In reply to

    Re: Convert SQL to MySQL

    I am looking for the fastest way to convert a MS SQL database to a MYSQL database.

     west palm beach marketing

     

  • 02-22-2012 9:43 PM In reply to

    Re: Convert SQL to MySQL

    You will need a converter to convert MS SQL to a MY SQL.'http://www.convertmydatabase.com/convert-database/mssql-mysql.html'. Check out this link you will get the converter as well as the instructions.

     

    Bathroom Faucets

     

     

Page 1 of 2 (19 items) 1 2 Next >
Powered by Community Server (Non-Commercial Edition), by Telligent Systems