Author |
Topic |
redbrad0
Advanced Member
USA
3725 Posts |
Posted - 05 December 2003 : 00:58:46
|
I have a SQL file which has text like below. I am trying to figure out how to run it and tried thru Query Anaylzer. When I try to run it, it says "[Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error" anyone have any ideas?
# --------------------------------------------------------
#
# Table structure for table `FORUM_ACTIVE_USERS`
#
CREATE TABLE `FORUM_ACTIVE_USERS` (
`MEMBER_ID` int(11) default NULL,
`AU_IP` varchar(40) default NULL,
`AU_LOGINTIME` varchar(100) default NULL,
`AU_LASTACTIVETIME` varchar(100) default NULL,
`AU_LASTPAGE` varchar(250) default NULL,
`AU_QUERYSTRING` text,
`AU_USER_AGENT` text
) TYPE=MyISAM;
#
# Dumping data for table `FORUM_ACTIVE_USERS`
#
# --------------------------------------------------------
#
# Table structure for table `FORUM_ADS_CATEGORY`
#
#####CREATE TABLE `FORUM_ADS_CATEGORY` (
##### `ID` int(11) NOT NULL auto_increment,
##### `CATEGORY_NAME` varchar(50) NOT NULL default '',
##### `DESCRIPTION` text,
##### PRIMARY KEY (`ID`)
#####) TYPE=MyISAM AUTO_INCREMENT=11 ;
#
# Dumping data for table `FORUM_ADS_CATEGORY`
#
INSERT INTO `FORUM_ADS_CATEGORY` VALUES (7, 'Jeep in vendita', '');
INSERT INTO `FORUM_ADS_CATEGORY` VALUES (8, 'Parti usate', 'qualsiasi componente usato vi avanzi');
INSERT INTO `FORUM_ADS_CATEGORY` VALUES (9, 'Richieste parti/pezzi/jeep', 'qui le vostre richieste');
INSERT INTO `FORUM_ADS_CATEGORY` VALUES (10, 'extra Jeep - varie', 'tutto quello che non č jeep..');
# --------------------------------------------------------
|
Brad Oklahoma City Online Entertainment Guide Oklahoma Event Tickets |
|
Gremlin
General Help Moderator
New Zealand
7528 Posts |
Posted - 05 December 2003 : 01:49:00
|
Don't you want to be running that against a mySQL Database rather than a SQL Server ? its a mySQL dump file. |
Kiwihosting.Net - The Forum Hosting Specialists
|
|
|
redbrad0
Advanced Member
USA
3725 Posts |
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 05 December 2003 : 12:00:16
|
quote: Originally posted by redbrad0
Well I exported the sql file from mysql but i need to import the data into ms sql server
Just use the SQL wizard to import, provided you have your DSN/ODBC set up for the database in mySQL. Real simple. |
|
|
|
redbrad0
Advanced Member
USA
3725 Posts |
Posted - 05 December 2003 : 15:08:13
|
Well I have tried to connect to the mySql database and the guy told me that I can not connect to it from outside their network which i thought was odd, they just have the web based admin section for it where i could export that script. |
Brad Oklahoma City Online Entertainment Guide Oklahoma Event Tickets |
|
|
redbrad0
Advanced Member
USA
3725 Posts |
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 05 December 2003 : 16:43:59
|
all you need is the ODBC and then create a DSN and use the import wizard in SQL Server. |
|
|
|
redbrad0
Advanced Member
USA
3725 Posts |
|
Gremlin
General Help Moderator
New Zealand
7528 Posts |
Posted - 06 December 2003 : 20:44:22
|
Or install your own mysql server quickly to do it on, only takes a few minutes to set it up really. Or alternatively covert the SQL by hand to MS SQL syntax. Is it a Snitz portal your trying to import ? maybe someone who already has that version running on MS SQL could do a SQL Dump for you. |
Kiwihosting.Net - The Forum Hosting Specialists
|
|
|
redbrad0
Advanced Member
USA
3725 Posts |
Posted - 07 December 2003 : 18:54:51
|
Well I have it all converted into a SQL file to run in Query Analyzer I get the following error...
Cannot insert explicit value for identity column in table 'FORUM_ADS_CATEGORY' when IDENTITY_INSERT is set to OFF.
Do I have to go thru each table and and set the Identity to No? That would take enough work itself to go thru all the tables. |
Brad Oklahoma City Online Entertainment Guide Oklahoma Event Tickets |
|
|
Gremlin
General Help Moderator
New Zealand
7528 Posts |
Posted - 07 December 2003 : 19:20:35
|
Just add it to your script
SET IDENTITY_INSERT table_name ON GO
|
Kiwihosting.Net - The Forum Hosting Specialists
|
|
|
redbrad0
Advanced Member
USA
3725 Posts |
Posted - 08 December 2003 : 14:06:50
|
Thank you that worked great, I used that and then after all the inserts of the records did
SET IDENTITY_INSERT table_name OFF
Only problem I have now is all the records of posts that have 's in them are causing problems with the import script. Looks like I will have to go thru each line and look at the messages |
Brad Oklahoma City Online Entertainment Guide Oklahoma Event Tickets |
|
|
Gremlin
General Help Moderator
New Zealand
7528 Posts |
Posted - 08 December 2003 : 18:11:08
|
Your getting a little further at least :) |
Kiwihosting.Net - The Forum Hosting Specialists
|
|
|
redbrad0
Advanced Member
USA
3725 Posts |
Posted - 08 December 2003 : 18:19:56
|
Yea but starting to look thru the 49,000 line insert file shows way to many 's in the data that would have to be changed to '' I need to figure out a way to use phpMyAdmin to export the data and move it into a new mySql that I can actually use DTS to transfer the data into MSSql |
Brad Oklahoma City Online Entertainment Guide Oklahoma Event Tickets |
|
|
Gremlin
General Help Moderator
New Zealand
7528 Posts |
Posted - 09 December 2003 : 01:30:45
|
Why not just run the SQL File through an ASP Script that does replaces for you ? use FSO to read it in line by line and do replaces in appropriate places. |
Kiwihosting.Net - The Forum Hosting Specialists
|
|
|
redbrad0
Advanced Member
USA
3725 Posts |
Posted - 09 December 2003 : 09:47:47
|
Well the reason why I am not sure about that is because the record sorta looks like this.
'this is the first column','column 2','more column's','last column'
so the only way i could think about doing it that i guess it to make sure its not the first or last character on the line and then before or after it doesnt have a , |
Brad Oklahoma City Online Entertainment Guide Oklahoma Event Tickets |
|
|
Topic |
|