Showing posts with label convert. Show all posts
Showing posts with label convert. Show all posts

Monday, March 12, 2012

MySQL to Sql Server 05

im trying to convert this table for a friend

1CREATE TABLE adminmessage (2adminmessageidINT UNSIGNEDNOT NULL AUTO_INCREMENT,3varnamevarchar(250)NOT NULLDEFAULT'',4dismissableSMALLINT UNSIGNEDNOT NULLDEFAULT'0',5scriptvarchar(50)NOT NULLDEFAULT'',6actionvarchar(20)NOT NULLDEFAULT'',7execurl mediumtextNOT NULL,8method enum('get','post')NOT NULLDEFAULT'post',9datelineINT UNSIGNEDNOT NULLDEFAULT'0',10status enum('undone','done','dismissed')NOT NULLdefault'undone',11statususeridINT UNSIGNEDNOT NULLDEFAULT'0',12PRIMARY KEY (adminmessageid),13KEY script_action (script, action),14KEY varname (varname)15)
and was wondering how to do it when mssql doesn't have enums :(You can useCHECK CONSTRAINTS to limit the field to some particular values.

MySQL to MsSQL 2005

Hi!

How can i convert this code to work with MsSQL 2005?

/Tomas

PartialClass skaalbInherits System.Web.UI.PageProtected Sub Button1_Click(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles Button1.ClickDim strConnectionStringAs String Dim strQueryAs String Dim MyConnectionAs OdbcConnectionDim myCommandAs OdbcCommandDim pathAs String = Server.MapPath("~/album") &"/"Dim albNameAs String = Trim(Replace(txtAlbum.Text,"'", "''")) Dim folderName As String = Trim(Replace(txtAlbum.Text, "'", "''")) folderName = Replace(folderName," ","_")Try If Not My.Computer.FileSystem.DirectoryExists(path & folderName)Then My.Computer.FileSystem.CreateDirectory(path & folderName) labelStatus.Text ="Folder <b>" & folderName &"</b> created!"Dim BeskrivningAs String = Trim(Replace(txtBeskrivning.Text,"'", "''")) strConnectionString = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=xxxxxxxx; DATABASE=xxxxxxx; UID=xxxxxxxx; PASSWORD=xxxxxxxxx; OPTION=3" MyConnection = New OdbcConnection(strConnectionString) MyConnection.Open() strQuery = "INSERT INTO tbl_albumet(alb_Namn, alb_Beskrivning, alb_Mapp) VALUES (?, ?, ?)" myCommand = New OdbcCommand(strQuery, MyConnection) myCommand.Parameters.AddWithValue("?", albName) myCommand.Parameters.AddWithValue("?", Beskrivning) myCommand.Parameters.AddWithValue("?", folderName) myCommand.ExecuteNonQuery() MyConnection.Close() Else labelStatus.Text = "Folder excist, pick another name!" End If Catch ex As Exception labelStatus.Text = "Unable to create folder!"End Try End SubEnd Class

Just useDriver={SQL Native Client}; in the connectionstring

mysql to mssql

i have dumped a mysql database to my my documents folder on my server, how can i convert this to a mssql database.

the database came from a site that was in php and of course using mysql, the database has all the users logon information and other information in there personal profile.

i would like to convert this to a mssql database and connect it to the new site i am doing in .net/C#

I don't think there is any conversion tool to do that.|||

You have to use mySQL ODBC data source and import data from this source to SQL server, you can use SSIS package. Another solution is to do it inside your C# code you can have two connections and copy data from first (MYSQL) to second (MSSQL).

SSIS package will be faster.

And after that, or better before you have to create database structure on MS SQL server. but remember that MYSQL and MS SQL are not compatible.

Friday, March 9, 2012

MySQL -> ms-sqlserver

Hi,
I have to convert an MySQL database into a ms-sqlserver database.
Anyone know a software (is is possible freeware or not so expensive) to
translate database?
I have only to translate tables, no triggers or stored procedures.
Or anyone can send me a link to a web site about this problem?
Tank you and escuse for my terrible english!

Simone (form Italy)Hi there,

I don't think you need to shell out for a seperate tool to do this. You
can use built in SQL Server tools but it might take more time.

One possible option for you is, in SQL Server, create a linked server
to your MySQL database. You'll probably use an ODBC provider but I'm
not sure of the specifics in that regard.

You can create a linked server via the GUI or using T-SQL but it's
generally easier through the GUI. There's a good write-up about it in
SQL Server Books Online so I would refer you to there first. However,
if you're not sure how to add the linked server just give us a buzz and
we'll see if together we can make it work.

For the purposes of transferring data, in your linked server definition
you might want to specify that you will connect to your MySQL database
as a user with admin rights.

After you've defined a linked server you can access the MySQL tables in
a query (once again, techniques for accessing linked servers can be
found in SQL Server Books Online). If your tables are already created
on SQL Server then do:

INSERT INTO <SQL Server Table>
SELECT * FROM <MySQL Table
If your tables aren't yet created on SQL Server you could do:

SELECT * INTO <SQL Server Table Name>
FROM <MySQL Table
Hope that helps a bit but sorry if it doesn't|||Ciao Simone,
se fai un Dump, io ho un programma per ricaricarlo in SQL server.
Fammi sapere...

-tom
Simone ha scritto:

> Hi,
> I have to convert an MySQL database into a ms-sqlserver database.
> Anyone know a software (is is possible freeware or not so expensive) to
> translate database?
> I have only to translate tables, no triggers or stored procedures.
> Or anyone can send me a link to a web site about this problem?
> Tank you and escuse for my terrible english!
> Simone (form Italy)|||Hi!

You could also use Oracle Migration Workbench (Migration Workbench).
Workbench can be downloaded from the technet website for free.
http://technet.oracle.com/tech/migr...ch/content.html.
o Migrate multiple MS SQL Server 6.5, MS SQL Server 7.0, MS SQL Server
2000,
MySQL3.22 and 3.23 Sybase Adaptive Server 11 and 12 databases to a single
Oracle database.

Cheers ;)
Jack

"Simone" <sp1213@.katamail.com> wrote in message
news:e4sodl$1n4v$1@.newsreader1.mclink.it...
> Hi,
> I have to convert an MySQL database into a ms-sqlserver database.
> Anyone know a software (is is possible freeware or not so expensive) to
> translate database?
> I have only to translate tables, no triggers or stored procedures.
> Or anyone can send me a link to a web site about this problem?
> Tank you and escuse for my terrible english!
> Simone (form Italy)