I have my present database in MYSQL. I am trying to export this data to my
new database in Sybase. I have dumped the database from Mysql and now
trying to import this dump to Sybase. Everything is fine except with the
'identity' and the 'datetime' fields.
I am not sure how to set 'identity_insert <table name> on'. Where do I do
that? On the command line?
The datetime field from Mysql is in the format of 20001127103523 (Nov 27th
2000 10:35:23 AM). But this format is not accepted in Sybase. Is there
anyother way I can do this?
Please help. Thank you in advance.
ps: Migrating to MS-Access from Mysql and then to Sybase is an option and
is it simpler than directly to Sybase from Mysql?
Date: Tue, 28 Nov 2000 10:36:42 -0500
Subject: Data Migration from mysql to Sybase
Content-Type: text/plain; charset="us-ascii"
Xref: forums-1-dub sybase.public.sqlserver.migration:360
Article PK: 1067783
From: Anthony Mandic <am@*t.com.au>
Organization: Mandic Consulting Pty. Ltd.
X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.2.14-5.0 i686)
Subject: Re: Data Migration from mysql to Sybase
Content-Type: text/plain; charset=us-ascii
Xref: forums-1-dub sybase.public.sqlserver.migration:357
Article PK: 1067780
Can you explain wht you mean by 'dumped' and 'import' here. You
won't be able to load a dump into Sybase from anything other than
Sybase - and even then only if the hardware is compatible.
So, I'll have to assume that you exported the data into a text file
from MySQL and are attempting to use bcp to import that text file.
> Everything is fine except with the 'identity' and the 'datetime' fields.
> I am not sure how to set 'identity_insert <table name> on'. Where do I do
> that? On the command line?
You won't be able to do that with bcp. It has a command line option
to handle it though. Set commands only work within a T-SQL session
(as with isql). An alternative solution is to bcp int oa temp table
first and then select into the target table with the above set option.
> The datetime field from Mysql is in the format of 20001127103523 (Nov 27th
> 2000 10:35:23 AM). But this format is not accepted in Sybase. Is there
> anyother way I can do this?
That should work (but I'm absolutely certain without testing it).
Perhaps using a format file may work.