VMware Cloud Community
dgreenbe
Contributor
Contributor

Error: Got exception: ERROR [42000] [Microsoft][SQL Native Client][SQL Server]Incorrect syntax near '-'.

I am trying to upgrade from VirtualCenter 2.0.2 to 2.5. The database upgrade fails everytime.

From the log:

Info: Name-VMInfrastructure has been detected as an SQL server.

Error: Got exception: ERROR [SQL Native Client][SQL Server]Incorrect syntax near '-'.

At some point later during the upgrade I get:

Error: Failed to execute SQL procedure. Got exception: ERROR [SQL Native Client][SQL Server]The specified @database_name ('Name-VMInfrastructur') does not exist.

Does the SQL upgrade script not handle "-" characters in DB names properly?

Also, while the DB rollback worked, Virtual Center still tried to complete installation. I had to manually uninstall VC 2.5 and reinstall VC 2.0.2 to get the server working again.

0 Kudos
5 Replies
EnsignA
Hot Shot
Hot Shot

For VC 2.0.2 you would seup your ODBC definition using the SQL Server driver. For VC 2.5, you need to create a new ODBC definition using the Native SQL Server driver or your upgrade will fail.

0 Kudos
dgreenbe
Contributor
Contributor

Thanks. The VC 2.5 install won't let you proceed with the install at all if the server is still using the "SQL Server" ODBC driver. The "[SQL Native Client]" in the error message indicates to me that the database upgrade is trying to use the SQL Native Client ODBC connection that I configured.

0 Kudos
EnsignA
Hot Shot
Hot Shot

Maybe I was unclear. When I did the upgrade, I had two ODBC connections to the VC DB. One using the Native driver and one with the SQL Server driver. Be sure that they do not point to VCDB as the default database. Then verify each of them can connect to SQL properly. WHen you start the upgrade on 2.0.2, you are using the SQL server ODBC DSN. WHen you get into the upgrade, it will ask for the DSN and you will enter the name and credentials used in the Native SQL Server DSN.

0 Kudos
dgreenbe
Contributor
Contributor

I'm not sure what you mean by "Be sure that they do not point to VCDB as the default database". If I change the default database in my ODBC setup to something other than the VCDB, The VirtualCenter Server service fails on startup.

I did try it with two ODBC connections, one with SQL Server and one using the Native Client. I got the same incorrect syntax near "-" error. I still think the upgrade sql scrip isn't handling the "-" in my database name properly.

0 Kudos
dgreenbe
Contributor
Contributor

I renamed the database and removed the "-" character. The upgrade worked after name change.

0 Kudos