MySQL Forums
Forum List  »  Newbie

connect
Posted by: harrha buen
Date: August 03, 2005 04:43PM

hi,
i am having problem trying to do this code in mysql

private void btnCreateDB_Click...
{
string strConnection = "IF EXISTS (SELECT * " +
"FROM master..sysdatabases " +
"WHERE name = N'CountriesStats')" +
"DROP DATABASE CountriesStats;" +
"CREATE DATABASE CountriesStats;";
//other codes
}

actually this code came from one of the sites i visited. i'm using mysql. i was trying to test this code and i got a message:

Failed to execute SQL : SQL IF EXISTS (SELECT * " + "FROM master..sysdatabases " + "WHERE name = N'CountriesStats')" + "DROP DATABASE CountriesStats;" + "CREATE DATABASE CountriesStats; failed : 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 'IF EXISTS (SELECT * " + "FROM master..sysdatabases " +

Options: ReplyQuote


Subject
Written By
Posted
connect
August 03, 2005 04:43PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.