Avatar of Panos
Panos
Flag for Germany asked on

sql error.

Hello experts.
i'm trying to run the script below in sql server and have the error:
Server: Msg 170, Level 15, State 1, Line 8
Line 8: Incorrect syntax near ';'.
Server: Msg 170, Level 15, State 1, Line 12
Line 12: Incorrect syntax near '`'.

Any help?
specie.sql
Microsoft SQL Server 2005SQL

Avatar of undefined
Last Comment
Panos

8/22/2022 - Mon
tigin44

try this
/*
SQLyog Community Edition- MySQL GUI v5.22a
Host - 5.0.24-community-nt : Database - test
*********************************************************************
Server version : 5.0.24-community-nt
*/


/*!40101 SET NAMES utf8 */;

/*!40101 SET SQL_MODE=''*/;

create database if not exists test;

USE test;

/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;

/*Table structure for table `specietype` */

DROP TABLE IF EXISTS specietype;

CREATE TABLE specietype (
  `TypeID` int(11) NOT NULL auto_increment,
  `Type` varchar(20) NOT NULL,
  PRIMARY KEY  (`TypeID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `specietype` */

insert  into specietype(`TypeID`,`Type`) values (1,'Mammals'),(2,'Birds'),(3,'Reptiles'),(4,'Fishes'),(5,'Corals'),(6,'Plants'),(7,'Seaweeds');


/*Table structure for table `specie` */

DROP TABLE IF EXISTS specie;

CREATE TABLE specie (
  `SpecieID` int(11) NOT NULL auto_increment,
  `TypeID` int(11) NOT NULL,
  `Specie` varchar(40) NOT NULL,
  PRIMARY KEY  (`SpecieID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `specie` */

insert  into specie(`SpecieID`,`TypeID`,`Specie`) values (1,1,'Baiji'),(2,1,'Western Gorilla'),(3,1,'Sumatran Orangutan'),(4,1,'Speke\'s Gazelle'),(5,2,'White-headed Vulture'),(6,2,'Egyptian Vulture'),(7,2,'Mauritius Parakeet'),(8,3,'Gharial'),(9,3,'Blunt-nosed Leopard Lizard'),(10,3,'Santa Catalina Island Rattlesnake'),(11,3,'Phelsuma Antanosy'),(12,3,'Coachella Valley Fringe-toed Lizard'),(13,3,'Giant Gartersnake'),(14,3,'Panamint Alligator Lizard'),(15,4,'Banggai Cardinalfish'),(16,4,'Humphead Parrotfish'),(17,5,'Floreana Coral'),(18,5,'Wellington\'s Solitary Coral'),(19,6,'Wild Apricot'),(20,7,'Galapagos Kelp');


/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;

Open in new window

Panos

ASKER
Hi.
Now i have this error:
Server: Msg 170, Level 15, State 1, Line 9
Line 9: Incorrect syntax near ';'.
Server: Msg 170, Level 15, State 1, Line 13
Line 13: Incorrect syntax near 'test'.
Server: Msg 170, Level 15, State 1, Line 17
Line 17: Incorrect syntax near ';'.
Server: Msg 170, Level 15, State 1, Line 25
Line 25: Incorrect syntax near '`'.
Server: Msg 170, Level 15, State 1, Line 32
Line 32: Incorrect syntax near '`'.
Server: Msg 170, Level 15, State 1, Line 40
Line 40: Incorrect syntax near '`'.
Server: Msg 170, Level 15, State 1, Line 48
Line 48: Incorrect syntax near '`'.
lammy82

That script is for MySQL, not SQL Server

I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Panos

ASKER
I have downloaded this from here:http://blog.webexterminator.com/index.cfm/2008/4/22/JQuery-Multiple-Selects-Example--SelectChainJS-and-ColdFusion
from the download link in the bottom.I don't know.
ASKER CERTIFIED SOLUTION
lammy82

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Panos

ASKER
Ohh!
Wrong answer.
So it is mysql.How can i change it to sql Server?
Panos

ASKER
I did not see your last post.
I will try to follow your suggention.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Panos

ASKER
Thank you
regards
panos