Application of Recursive Query on Structured Query Language Server

TP311; The advantage of recursive programming is that it is very easy to write and it only requires very few lines of code if done correctly.Structured query language(SQL)is a database language and is used to manipulate data.In Microsoft SQL Server 2000,recursive queries are implemented to retrieve...

Full description

Saved in:
Bibliographic Details
Published in东华大学学报(英文版) Vol. 40; no. 1; pp. 68 - 73
Main Authors XUN Xuelian, ABHIJIT Sen, YAO Zhiqiang
Format Journal Article
LanguageEnglish
Published Library,North China Institute of Aerospace Engineering,Langfang 065000,China%Department of Computer Science&Information System,Kwantlen Polytechnic University,Surrey,Canada%School of Computer Science and Engineering,North China Institute of Aerospace Engineering,Langfang 065000,China 2023
Subjects
Online AccessGet full text

Cover

Loading…
More Information
Summary:TP311; The advantage of recursive programming is that it is very easy to write and it only requires very few lines of code if done correctly.Structured query language(SQL)is a database language and is used to manipulate data.In Microsoft SQL Server 2000,recursive queries are implemented to retrieve data which is presented in a hierarchical format,but this way has its disadvantages.Common table expression(CTE)construction introduced in Microsoft SQL Server 2005 provides the significant advantage of being able to reference itself to create a recursive CTE.Hierarchical data structures,organizational charts and other parent-child table relationship reports can easily benefit from the use of recursive CTEs.The recursive query is illustrated and implemented on some simple hierarchical data.In addition,one business case study is brought forward and the solution using recursive query based on CTE is shown.At the same time,stored procedures are programmed to do the recursion in SQL.Test results show that recursive queries based on CTEs bring us the chance to create much more complex queries while retaining a much simpler syntax.
ISSN:1672-5220
DOI:10.19884/j.1672-5220.202110001