quey conversion from oracle to sqlserver?

Discussion in 'ASP .Net' started by ravi, Apr 19, 2008.

  1. ravi

    ravi Guest

    hi friends,
    The below given query is work on oracle.Help me out write same query
    on sqlserve i want the same resule.
    select * from (select trunc(sysdate) + level from dual
    2 connect by level <= 10);

    TRUNC(SYS
    ---------
    28-OCT-06
    29-OCT-06
    30-OCT-06
    31-OCT-06
    01-NOV-06
    02-NOV-06
    03-NOV-06
    04-NOV-06
    05-NOV-06
    06-NOV-06

    10 rows selected.
     
    ravi, Apr 19, 2008
    #1
    1. Advertising

  2. ravi

    bruce barker Guest

    you need to use the ansi sql syntax, rather then orcale's. in ansi sql
    you use common table expressions (CTE) and union all to perform
    hierarchical joins. the docs have examples

    -- bruce (sqlwork.com)




    ravi wrote:
    > hi friends,
    > The below given query is work on oracle.Help me out write same query
    > on sqlserve i want the same resule.
    > select * from (select trunc(sysdate) + level from dual
    > 2 connect by level <= 10);
    >
    > TRUNC(SYS
    > ---------
    > 28-OCT-06
    > 29-OCT-06
    > 30-OCT-06
    > 31-OCT-06
    > 01-NOV-06
    > 02-NOV-06
    > 03-NOV-06
    > 04-NOV-06
    > 05-NOV-06
    > 06-NOV-06
    >
    > 10 rows selected.
     
    bruce barker, Apr 19, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Syed Mudussir Husain

    Oracle or SQLServer - .NET or J2EE?

    Syed Mudussir Husain, Aug 15, 2003, in forum: ASP .Net
    Replies:
    7
    Views:
    381
    Christian Boult
    Aug 16, 2003
  2. =?Utf-8?B?SmVmZnJleQ==?=

    Upgrading ASP w/SQLserver 2000 to ASP.NET w/ SQLserver 2005

    =?Utf-8?B?SmVmZnJleQ==?=, Apr 6, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    517
    sloan
    Apr 27, 2007
  3. ravi
    Replies:
    1
    Views:
    259
    Lloyd Sheen
    Apr 19, 2008
  4. Don Juan
    Replies:
    3
    Views:
    407
    Munna
    Jun 24, 2008
  5. Feyruz
    Replies:
    4
    Views:
    2,337
    Sherm Pendley
    Oct 14, 2005
Loading...

Share This Page