Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Start with and Connect by

Author  Topic 

ag_ss
Starting Member

48 Posts

Posted - 2006-03-24 : 08:09:58
Hi I am new to sql server
i wanna convert one oracle query to t-sql

select r.v_attr from rule r connect by r.src_attr = prior r.v_attr start with r.src_attr = parent.v_attr

t-sql doesnt support start with and connect by

any help will be appreciated
thanx

nr
SQLTeam MVY

12543 Posts

Posted - 2006-03-24 : 08:35:19
Have a look at common table expressions if you are using v2005 otherwise you will have to do it using a loop or recursion.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

ag_ss
Starting Member

48 Posts

Posted - 2006-03-24 : 08:39:10
i am using v2005
how to use CTE
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2006-03-24 : 09:49:06
Have a look in bol - there is an example to do what you are looking for I believe.
Look for CTEs.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

ag_ss
Starting Member

48 Posts

Posted - 2006-03-27 : 00:03:04
Have a look in bol - there is an example to do

how to check it (bol)
plz let me know
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-03-27 : 00:38:58
bol is Books On Line, SQL Server help file. Search there for common table expressions

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

ag_ss
Starting Member

48 Posts

Posted - 2006-03-27 : 00:58:10
plz let me know the link to bol
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2006-03-27 : 06:55:50
Load management studio, click on index then type CTE in the look for text box at top left.
Double click on CTEs and it will take you to the article.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

ag_ss
Starting Member

48 Posts

Posted - 2006-03-27 : 08:34:11
thanx i got it but it didnt help much
Go to Top of Page
   

- Advertisement -