mysql - Importing database to ms sql server -
i trying import database phpmyadmin sql server, getting error when trying execute sql code create it:
msg 156, level 15, state 1, line 10 incorrect syntax near keyword 'if'. msg 102, level 15, state 1, line 10 incorrect syntax near 'nih_bw'. msg 911, level 16, state 1, line 11 database 'nih_bw' not exist. make sure name entered correctly.
this database:
set time_zone = "+00:00"; /*!40101 set @old_character_set_client=@@character_set_client */; /*!40101 set @old_character_set_results=@@character_set_results */; /*!40101 set @old_collation_connection=@@collation_connection */; /*!40101 set names utf8 */; -- -- database: "nih_bw" -- create database if not exists "nih_bw" default character set latin1 collate latin1_swedish_ci; use nih_bw; -- -------------------------------------------------------- -- -- table structure table "emps" -- create table "emps" ( "id" int not null, "user_name" varchar(25) not null, "first_name" varchar(15) not null, "last_name" varchar(15) not null, "email" varchar(25) not null, "password" varchar(25) not null, "user_type" char(5) not null, primary key ("id") ); -- -- dumping data table "emps" -- set identity_insert "emps" on ; insert "emps" ("id", "user_name", "first_name", "last_name", "email", "password", "user_type") values (1, 'root', 'root', 'root', 'root@gmail.com', 'hei123', 'user'); set identity_insert "emps" off; -- -------------------------------------------------------- -- -- table structure table "measurements" -- create table "measurements" ( "id" int not null, "title" varchar(25) not null, primary key ("id") ); -- -- dumping data table "measurements" -- set identity_insert "measurements" on ; insert "measurements" ("id", "title") values (1, 't_badende_per_time'), (2, 't_temperatur'), (3, 't_luft_temperatur'), (4, 'm_fritt_klor'), (5, 'm_bundet_klor'), (6, 'm_total_klor'), (7, 'm_ph'), (8, 'm_auto_klor'), (9, 'm_auto_ph'), (10, 'm_redox'), (11, 'o_vannbalanse'), (12, 'o_alakalitet'), (13, 'o_hardhet'), (14, 'o_natrium_bk'), (15, 'o_kals_klor'), (16, 'o_sjokklor'), (17, 'o_fellingsmiddel'), (18, 'o_sirkulasjonsmengde'), (19, 'o_filtertrykk'), (20, 'o_spyl_av_filter'), (21, 'o_vannforbruk'), (22, 'o_slamsuging'), (23, 'o_harsil'), (24, 'o_ren_utj_tank'); set identity_insert "measurements" off; -- -------------------------------------------------------- -- -- table structure table "measure_routine" -- create table "measure_routine" ( "routine_id" int not null, "measure_id" int not null, "pool_id" int default null, primary key ("routine_id","measure_id"), key "pool_id" ("pool_id"), key "link3" ("measure_id") ); -- -------------------------------------------------------- -- -- table structure table "pools" -- create table "pools" ( "id" int not null, "name" varchar(20) not null, primary key ("id") ); -- -- dumping data table "pools" -- set identity_insert "pools" on ; insert "pools" ("id", "name") values (1, 'hovedbasseng'), (2, 'plaskebasseng'), (99, 'svommehall'); set identity_insert "pools" off; -- -------------------------------------------------------- -- -- table structure table "routines" -- create table "routines" ( "id" int not null, "date" datetime not null, "time" time not null, "value" varchar(10) not null, "emp_id" int not null, primary key ("id"), key "emp_id" ("emp_id") ); -- -------------------------------------------------------- -- -- table structure table "tasks" -- create table "tasks" ( "id" int not null, "title" varchar(25) not null, primary key ("id") ); -- -- dumping data table "tasks" -- set identity_insert "tasks" on ; insert "tasks" ("id", "title") values (40, 'd_slamsuge_pl_bass'), (41, 'd_filter_rens'), (42, 'd_bypass_pl_bass'), (43, 'd_vaske_gulv_cm'), (44, 'd_garderobe_0730'), (45, 'd_garderobe_dag'), (46, 'd_male_temp_just'), (47, 'd_vaske_pl_bass'), (48, 'd_vaske_h_bass'), (49, 'd_renhold_av_wc'), (50, 'd_ettersyn_utst_skap'), (51, 'd_handicap_heis'), (52, 'd_ettersyn_solarier'), (53, 'd_vannprove_0745'), (54, 'd_vannprover_1100'), (55, 'd_vannprover_1400'), (56, 'd_enkle_vedliks_oppg'), (57, 'd_sjekk_skiftplan'), (58, 'k_oppdatere_seg_ikkeutf'), (59, 'k_vannprover_1700'), (60, 'k_vannprover_2000'), (61, 'k_vaske_pl_bass'), (62, 'k_vaske_h_bass'), (63, 'k_sla_av_bypass'), (64, 'k_ettersyn_materiell'), (65, 'k_ettersyn_solarier'), (66, 'k_ettersyn_sal_4'), (67, 'k_runde_gard_kveld'), (68, 'k_runde_gard_for_steng'), (69, 'k_enkle_vedlik_oppg'), (70, 'k_rullestolheis_lading'), (71, 'k_etterfylle_skoposer'), (72, 'k_skap_lases'), (73, 'k_sjekk_skiftplan'), (74, 'k_rydd_tribune'), (75, 'k_slamsug_h_bass'), (76, 'k_stenge_prosedyre'), (77, 'k_beskjed_h_vakt'), (78, 'k_timeteller'), (79, 'c_timeteller'), (80, 'c_allrent'), (81, 'c_grovrent_ekstra'), (82, 'c_ren_opplos_tank'), (83, 'c_ren_opps_tank'), (84, 'c_ren_flott_gitter'), (85, 'c_ren_opplos_filter'), (86, 'c_ren_nal'), (87, 'c_kontr_slang_tank'), (88, 'c_kont_ren_kostpad'); set identity_insert "tasks" off; -- -------------------------------------------------------- -- -- table structure table "task_routine" -- create table "task_routine" ( "routine_id" int not null, "task_id" int not null, primary key ("routine_id","task_id"), key "link6" ("task_id") ); -- -- constraints dumped tables -- -- -- constraints table "measure_routine" -- alter table "measure_routine" add constraint "link2" foreign key ("routine_id") references "routines" ("id") on delete cascade on update cascade, add constraint "link3" foreign key ("measure_id") references "measurements" ("id") on delete cascade on update cascade; -- -- constraints table "routines" -- alter table "routines" add constraint "link1" foreign key ("emp_id") references "emps" ("id") on delete cascade on update cascade; -- -- constraints table "task_routine" -- alter table "task_routine" add constraint "link5" foreign key ("routine_id") references "routines" ("id") on delete cascade on update cascade, add constraint "link6" foreign key ("task_id") references "tasks" ("id") on delete cascade on update cascade; /*!40101 set character_set_client=@old_character_set_client */; /*!40101 set character_set_results=@old_character_set_results */; /*!40101 set collation_connection=@old_collation_connection */;
i think need take @ first statement trying create database , start script follows
use master; go if db_id('dbname') not null drop database nih_bw go create database [nih_bw] on primary ( name = n'nih_bw' , filename = n'c:\path_mdf_file\nih_bw.mdf' , size = 5120000kb , filegrowth = 1024kb ) log on ( name = n'nih_bw_log' , filename = n'd:\path_for_ldf_file\nih_bw_log.ldf' , size = 512000kb , filegrowth = 10%) collate sql_swedishstd_pref_cp1_ci_as go use [nih_bw] go /* here continue rest of script */
Comments
Post a Comment