September 9, 2011 at 8:13 am
Hi Guys, I am having some trouble getting a stored procedure to run, I think it is something to do with the Begin Go End statements but I am note sure please see below for the Errors and the offending lines! I was given this code and have not written it myself, although have been using sql for several months now in my current job!
Msg 102, Level 15, State 1, Line 10
Incorrect syntax near '='.
Msg 102, Level 15, State 1, Line 28
Incorrect syntax near '`'.
Msg 102, Level 15, State 1, Line 1508
Incorrect syntax near '`'.
Msg 102, Level 15, State 1, Line 2040
Incorrect syntax near '`'.
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
CREATE TABLE IF NOT EXISTS `StormHeader` (
CREATE TABLE IF NOT EXISTS `StormHeaderLocUS` (
CREATE TABLE IF NOT EXISTS `StormObservations` (
If you need the full code then let me know, thanks for helping!
September 9, 2011 at 8:17 am
Full code.
Also I'd try changing ` to real apostrophes (quick search / replace).
September 9, 2011 at 8:20 am
dave could that be mySQL that you pasted?
the syntax doesn't match SQL server;
the equivilent would be like this:
IF Object_id('StormHeader') IS NULL
CREATE TABLE StormHeader ( ...rest of definition
Lowell
September 9, 2011 at 8:23 am
I think you'll find the SQL you've posted is for MySQL, not SQL Server.
There is no such setting as SQL_MODE in SQL Server, and your conditional table creation isn't in SQL Server syntax
September 9, 2011 at 1:02 pm
Hey Guys,
Thanks for your replies, yup so looks like its mySQL is it a simple case of replacing those 4 lines of code with the SQL equivelent?
I have tried pasting the entire code here but it errors, i think its too big is there any otherway I can send it?
Here is a link the data I am trying to get into SQL > http://www.aoml.noaa.gov/hrd/hurdat/tracks1851to2010_atl_reanal.html
Thanks again!
September 9, 2011 at 1:31 pm
Thanks for the reply so do I need to change the other 4 error lines into SQL and not mySQL the file is too big to post on the forum!
Many Thanls
September 9, 2011 at 1:43 pm
Converting MySQL code to SQL Server code is far from a trivial exercise. You'll probably need to near-rewrite the whole thing.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply