Showing posts with label syntax. Show all posts
Showing posts with label syntax. Show all posts

Wednesday, March 7, 2012

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

DBNull Error

Am getting errors on this syntax:

Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)

Row.myColumn = DBNull.Value

Value of type 'System.DBNull' cannot be converted to type 'String'

Any ideas? Just want to set the myColumn to NULL.

Thanks

Nevermind.

Row.myColumn = Nothing

dbms_utility.get_time equivalent in sql server

Hi,
I need to convert the following oracle syntax to sql server:
timevar number;
timevar := dbms_utility.get_time;
This prints : 50989467
I aware of the function getDate() or current_timestamp but they display only the dates and if I convert them to float then the results are not same. Any pointers will be appreciated.
Srik

Hi,

I believe the dbms_utility.get_time routine is used mainly for timing loops. It returns the # of 100ths of a second since "some arbitrary epoch". Therefore, it doesn't have much meaning outside of marking elapsed time.

The SQL Server datetime data type has a resolution of 3.33 milliseconds. You can use the DATEDIFF() built-in function to return the elapsed # of milliseconds between two datetime values. Therefore, it may be something you can use in a way that is similar to Oracle's dbms_utility.get_time routine. Please note that the return type of the DATEDIFF() built-in function is a 32-bit signed integer, which means the the maximum possible elapsed time in millisecond units is equivalent to 24 days, 20 hours, 31 minutes and 23.647 seconds. Anything beyond that will cause an arithmetic overflow.

Here is a sample usage.

declare @.now datetime, @.then datetime
select @.then = getdate()
waitfor delay '000:00:02'
select @.now = getdate()
select datediff(millisecond, @.then, @.now)

Let us know if this answers your question and works for you.

Clifford Dibble
Program Manager, SQL Server

|||Thanks a lot for your response: I have a procedure which stores the dbms_utility.get_time into a localvariable and passes this variable to another procedure. For eg:
timevar number;
timevar := dbms_utility.get_time;
myproc(timevar);

any equivalent syntax will be useful.|||As far as I know, there is nothing directly equivalent to dbms_utility.get_timedbms_utility.getime in T-SQL. You will need to synthesize it using the technique shown in the prior post or you will need to cast the datetime bits using an expression like this:

select cast(cast(getdate() as binary(8)) as bigint)

Regards,
Clifford Dibble
Program Manager, SQL Server