Technical Article

Query Hierarchical data Using CTE in T-SQL 2005

In response to Sam Stange's "An old and new way to query Hierarchical data", this script uses the new CTE feature of SQL Server 2005 to display the hierarchical data all at once. I have added a check to prevent infinite loop in case there is a loop in the data (actually, there is one […]

3.67 (3)

2007-04-11 (first published: )

1,426 reads

Technical Article

Function Based Index in T-SQL

To build function based index in SQL Server, you can use indexed view (materialized view) or using a computed column. In this script, I give an exmaple of how to use the computed column to implement a function based index on a table to search through a free formated telephone number column. The basic step […]

5 (3)

2007-04-10 (first published: )

6,792 reads

Blogs

Tales From The Field Weekly Wrap Up for the Week of 01-31-2023

By

 Hello Dear Reader!  After a weekend with a lot of activities, it was a...

Creating a Flyway Desktop Shadow Database in PostgreSQL

By

In order to generate migrations, we need to configure Flyway to use a shadow...

Daily Coping 6 Feb 2023

By

Today’s coping tip is to get back in contact with an old friend. This...

Read the latest Blogs

Forums

Future of SQL Server DBA Role

By Feivel

I would like to know what certifications or paths to choose in order to...

Extended Events shows each SQL command in one long line

By SQL Guy 1

Hi all, I created Extended Events session to capture sql_batch_completed for duration>5 sec sending...

Group by issue

By pedroccamara

Hello everyone!! I have this SQL statement: SELECT dateadd(year,(2023 - year(DH.DOC_DATE)),DH.DOC_DATE) AS 'Date', DD.STORE_CODE...

Visit the forum

Ask SSC Logo Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers