dbTalk Databases Forums  

mySQL to MS SQL - Primary Keys

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss mySQL to MS SQL - Primary Keys in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Michael Johnson
 
Posts: n/a

Default mySQL to MS SQL - Primary Keys - 02-20-2006 , 12:42 PM







Trying to convert a mySQL database to MSSQL. Using Import data in SQL Server
2000, it works fine, however I get no primary keys defined on any of the
tables, am I missing something? Or is there a tool that would do this?

Many thanks.



Reply With Quote
  #2  
Old   
Michael Johnson
 
Posts: n/a

Default Re: mySQL to MS SQL - Primary Keys - 02-20-2006 , 12:46 PM






Oops, forgot to mention that I'm using the MySQL 3.51 ODBC connector in the
import process.


Quote:
Trying to convert a mySQL database to MSSQL. Using Import data in SQL
Server 2000, it works fine, however I get no primary keys defined on
any of the tables, am I missing something? Or is there a tool that
would do this?

Many thanks.




Reply With Quote
  #3  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: mySQL to MS SQL - Primary Keys - 02-20-2006 , 01:41 PM



Hello Michael,


Nope you are missing nothing. There is no way in DTS to do this, likewise
you cannot do this with an Access DB. The only DB type that you can do this
with is SQL Server --> SQL Server.

A solution would be to read the metadata for the keys and indexes from MySQL
and bulid the appropriate SQL Server equivalent statements and apply them.



Allan Mitchell
www.SQLDTS.com
www.SQLIS.com
www.Konesans.com

Quote:
Trying to convert a mySQL database to MSSQL. Using Import data in SQL
Server 2000, it works fine, however I get no primary keys defined on
any of the tables, am I missing something? Or is there a tool that
would do this?

Many thanks.




Reply With Quote
  #4  
Old   
Michael Johnson
 
Posts: n/a

Default Re: mySQL to MS SQL - Primary Keys - 02-20-2006 , 04:34 PM



Hello Allan,

Thanks for the info, was hoping that I would not need to write a bunch of
code to get this information out of the mySQL database and then parse it
against SQL Server. Looks like a good use of a late night coding, perhaps
I'll throw the code out on CodeProject once I'm done.........

Know that there are converters, but why spend hundreds when you can write
it yourself in an evening.........

Quote:
Hello Michael,

Nope you are missing nothing. There is no way in DTS to do this,
likewise you cannot do this with an Access DB. The only DB type that
you can do this with is SQL Server --> SQL Server.

A solution would be to read the metadata for the keys and indexes from
MySQL and bulid the appropriate SQL Server equivalent statements and
apply them.

Allan Mitchell
www.SQLDTS.com
www.SQLIS.com
www.Konesans.com
Trying to convert a mySQL database to MSSQL. Using Import data in
SQL Server 2000, it works fine, however I get no primary keys defined
on any of the tables, am I missing something? Or is there a tool
that would do this?

Many thanks.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.