cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ridch01
Level 5

jdbc error

I'm having some problems with my installer executing a simple .sql script. My host system is Windows 2003 with SQL Server 2005 installed (same box). I am passing in the correct credentials.
When the installer tries to execute my script, I get a cryptic message in the log: An error occurred while running the script: (102) Incorrect syntax near 'GO'

I looked around line 102 of the file.sql - didn't see any problems.

I can use Microsoft's osql.exe to install the same script as well as run it with SQL Server 2005's manager tools. I won't necessarliy have osql.exe on the install boxes - so need the JDBC implementation working.
Labels (1)
0 Kudos
(2) Replies
purcellk24
Level 7

In my experience, I have found out that those "simple" sql scripts for MSSQL are not JDBC compliant. They are more like batch commands. That is why it works fine in the manager tools and osql.exe.

I'm not sure what your final plan should be, but you may have to require the MSSQLServer client installed, or you have to re-write your sql scripts to be JDBC compilant.

If I'm off my rocker, please let me know.
0 Kudos
ridch01
Level 5

I figured out my problem. It was the sql script. A sample of what we had:
some valid db commands
GO

The GO was the problem. I replaced that with a semicolon ; - fixed it. Using Microsoft's tools, osql.exe and query analyzer were ok with the GO. The JDBC was not.

ANyway, it works fine now and I don't require a database client on the boxes.
0 Kudos