Oralle to SQL conversion "start with" and "connect by prior "

Ashwan 521 Reputation points
2020-11-17T05:41:02.633+00:00

Hi I am currently converting Oracle database to SQL Server 2016 Sp2 database and hitting some issue with coversion on following key works
"start with "
"connect by prior "

++++++++++++++++++++++++++++++++++++
with equip_parent as (
select
substr(sys_connect_by_path( proprty_no, ':'), 2, 12) as property,
equ_no as child
from crms.DVF678
start with property_class in ('VS', 'SS', 'ZT')
connect by prior prperty_no = parent_equip
)

any one can help would be much appreciated
thanks

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,376 questions
SQL Server Migration Assistant
SQL Server Migration Assistant
A Microsoft tool designed to automate database migration to SQL Server from Access, DB2, MySQL, Oracle, and SAP ASE.
517 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. tibor_karaszi@hotmail.com 4,306 Reputation points
    2020-11-17T08:07:56.927+00:00

    My guess is that a recursive CTE can do the trick. Here's an article I found after a quick google search: https://www.sqlservertutorial.net/sql-server-basics/sql-server-recursive-cte/


  2. CathyJi-MSFT 21,136 Reputation points Microsoft Vendor
    2020-11-18T09:09:57.607+00:00

    Hi @Ashwan ,

    Search this from google, check if this thread could help you. Converting ORACLE hierarchical START WITH / CONNECT BY PRIOR to SQL Server CTE

    Best regards,
    Cathy


    If the response is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments