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/
Oralle to SQL conversion "start with" and "connect by prior "
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
2 answers
Sort by: Most helpful
-
-
CathyJi-MSFT 22,286 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.