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,411 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,232 reads

Blogs

SQL Homework – July 2022 – Update your resume.

By

Resumes have been on my mind a lot recently. I’ve been thinking that I...

A Blogging Break

By

Outside of coping tips, I’m gonna take a break from blogging. I’ve been aiming...

Daily Coping 5 Jul 2022

By

I started to add a daily coping tip to the SQLServerCentral newsletter and to...

Read the latest Blogs

Forums

Group by column over partition ordered by date

By diegodeveloper

Hi Everyone. I need a script to get the first and second null value...

First responders kit - BlitzIndex question

By Siten0308

Hello, hope someone can help, maybe a simple question so i am using the...

Quick SQL challenges for mid-experienced+ DBAs (and advanced T-SQLers)

By ScottPletcher

(1) Sort rows with year column (smallint) and month (char(3)) column == Jan, Feb,...

Visit the forum

Ask SSC Logo Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers