Showing posts with label conversion. Show all posts
Showing posts with label conversion. Show all posts

Wednesday, March 7, 2012

DDL file to convert from mySQL to SQLServerXXX

We want to migrate a mySQL database to sql server 2000 or sql Server 2005. I have been given a DDL file to perform the conversion, but I don't know what to do with the file? Can anyone help me out? From what I can conclude, the DDL files is a script. So how do I run this script? Where do I place the file, before I run it?

Please help !

IF its a small file (with few tables/storedprocs/views..etc) I would go through the script to check for syntax errors. You could even to a "syntax check" from the query analyzer of SQL Server. Get the script fixed if there are any issues. Then create a database on SQL Server and compile the scripts against the DB.I believe there are SQL Server upgrade/migrate advisors. you can always google and check out any tips.|||

Try this blog and if it work let me know

http://weblogs.asp.net/scottgu/archive/2005/08/25/423703.aspx

DDL Conversion

Hi,

How do you convert DDL statements of SQL Server, which are
generated by DTS into other database vendors' syntax (IBM
DB2 or Oracle)?
Any utility tool?

Thank you,

--jaquesjaquesbosch2@.yahoo.de (Jaques) wrote in message news:<569b197f.0311021228.1602722d@.posting.google.com>...
> Hi,
> How do you convert DDL statements of SQL Server, which are
> generated by DTS into other database vendors' syntax (IBM
> DB2 or Oracle)?
> Any utility tool?
> Thank you,
> --jaques

There are a number of third-party products which can do this - I've
used Embarcadero products for similar tasks, which generally work
well, although they can be expensive. The disadvantage of these tools
is that there will always be some platform-specific data types or
syntax which may not be cleanly scripted because there is no direct
equivalent. So there will usually be some amount of manual
checking/modification required.

Simon|||Hi

If you are using a modelling tool, then this may produce the scripts for the
different database systems.

John

"Jaques" <jaquesbosch2@.yahoo.de> wrote in message
news:569b197f.0311021228.1602722d@.posting.google.c om...
> Hi,
> How do you convert DDL statements of SQL Server, which are
> generated by DTS into other database vendors' syntax (IBM
> DB2 or Oracle)?
> Any utility tool?
> Thank you,
> --jaques

Friday, February 17, 2012

dbms_lob conversion

hi,
am interested in porting some of my oracle quries to sqlserver. Here is a sample oracle procedure:
create procedure sp1(ac_clob clob)
as
n number;
position number;
begin
position := 4;
n := dbms_lob.instr(ac_clob,'test', position); --returns the location of the substring
n: = dbms_lob.getlength(ac_clob); --returns the length of the clob object
end;
As the clob object comes as a parameter let me know if it can be converted in sql server. Also I some other functions to dbms_lob packages like: dbms_lob.copy, dbms_lob.write, dbms_lob.trim,Hi,

SQL Server does not have the exact same functionality as the DBMS_LOB package. For example, there is no direct I/O between files and blob variables, and blob variables are not allowed as local variables. You need to use BULK INSERT and/or chunk-mode reads and writes from TSQL. ADO as a Stream class that makes this much easier from a client app.

In SQL2K we do support some functions on text columns (like CLOBs in Oracle) from the TSQL level, including DATALENGTH(), PATINDEX(), and SUBSTRING().

See:
Managing ntext, text, and image Data
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/acdata/ac_8_qd_13_8orl.asp

In SQL 2005, we've introduced a new feature called "large-value types", which allow you to treat CLOBS just like normal string values. You can declare local variables, use them in expressions, pass them as parameters, return them from functions, cast to/from XML, and so on. They have become a first-class data type in the TSQL language. Their declarations look like

varchar(max), nvarchar(max), varbinary(max)

It's really a great SQL 2005 feature, and it makes life *much* easier when dealing with CLOBS and BLOBs from within TSQL.

Regards,
Clifford Dibble
Program Manager, SQL Server|||Thanks for your suggestions|||In addition to what Clifford says, you can take a look at the CHARINDEX, PATINDEX and SUBSTRING functions which give you the functionality you have in your sample code. These should work in both SQL 2000 and SQL 2005.

- Christian