Advanced T-SQL

Stairway to Advanced T-SQL

Stairway to Advanced T-SQL Level 8: Functions to Generate Date and Time values

  • Stairway Step

When you build applications that store records in SQL Server you will most likely have to store date and time values as part of the data. To manage all the different date related tasks you might need to perform Microsoft has introduced a number of date functions. In this stairway I will be exploring those date and time functions.

You rated this post out of 5. Change rating

2015-10-21

12,374 reads

Stairway to Advanced T-SQL

Stairway to Advanced T-SQL Level 7: Ordering Your Data Using Ranking Functions

  • Stairway Step

In SQL Server there are 4 different ranking functions: RANK, DENSE_RANK, NTILE, and ROW_NUMBER. These ranking functions were introduced in SQL Server 2005. In this stairway level I will be reviewing each of these different ranking functions, and will show you how to use them by providing a few examples.

5 (2)

You rated this post out of 5. Change rating

2015-09-02

14,584 reads

Stairway to Advanced T-SQL

Stairway to Advanced T-SQL Level 6: Creating Rows Of Data Using The UNPIVOT Operator

  • Stairway Step

The UNPIVOT operator does just the opposite of the PIVOT operator, which we looked at in the previous level. By using the PIVOT operator we can take multiple rows of data and create as single row as output. The UNPIVOT operator will take values from a single row and will create multiple rows. Microsoft introduced the UNPIVOT operator when they rolled out SQL Server 2005. In this level I will be showing you different examples of how to use the UNPIVOT operator.

You rated this post out of 5. Change rating

2022-01-05 (first published: )

10,300 reads

Stairway to Advanced T-SQL

Stairway to Advanced T-SQL Level 5: Turning Data On Its Side Using PIVOT Operator

  • Stairway Step

The PIVOT operator was added to the Transact-SQL language in SQL Server 2005. It allows you to turn your row data on its side, so it can be presented as column data. This is useful when you want take unique column values and have them displayed as column headings, where the column headings are associated with summarized values displayed below each column heading. In this article I will be exploring how to use the PIVOT operator.

4 (4)

You rated this post out of 5. Change rating

2022-01-12 (first published: )

22,051 reads

Stairway to Advanced T-SQL

Stairway to Advanced T-SQL Level 4: Record Level Processing Using Transact-SQL Cursors

  • Stairway Step

Using a CURSOR is not normally the best way to process through a set of records. Yet when a seasoned programmer moves to writing TSQL for the first time they frequently look for ways to process a sets of records one row at a time. They do this because they are not used to thinking about processing records as a set. In order to process through a TSQL record set a row at a time you can use a cursor. A cursor is a record set that is defined with the DECLARE CURSOR statement. Cursors can be defined as either read-only or updatable. In this article I will introduce you to using cursors to do record level processing one row at a time.

4 (1)

You rated this post out of 5. Change rating

2021-04-14 (first published: )

11,499 reads

Stairway to Advanced T-SQL

Stairway to Advanced T-SQL Level 2: Using the APPLY Operator

  • Stairway Step

The APPLY operator allows you to join a record set with a function, and apply the function to every qualifying row of the table (or view). The APPLY operator takes on two formats: CROSS APPLY, or OUTER APPLY. This article will explain the differences between these two formats, and show you examples of how each of these formats work.

4.88 (8)

You rated this post out of 5. Change rating

2021-05-05 (first published: )

25,401 reads

Stairway to T-SQL Beyond The Basics

Stairway to T-SQL: Beyond The Basics Level 5: Storing Data in Temporary Tables

  • Stairway Step

There are times when retrieving data for complex business requirement requires you to temporarily store one or more results sets for a short period of time. Typically these temporary tables are stored in the scope of the current connection, but they may also need to be available across multiple connections.

You rated this post out of 5. Change rating

2019-03-26 (first published: )

15,034 reads

Stairway to T-SQL Beyond The Basics

Stairway to T-SQL: Beyond The Basics Level 4: Using Views to Simplify Your Query

  • Stairway Step

This level discusses how to use a database VIEW to simplify your Transact-SQL(T-SQL) code. By understanding how to use a VIEW you will be able to better support writing T-SQL code to meet complex business requirements. In this article I will be discussing what a database VIEW is and then providing a number of examples to help you understand how you can use a VIEW to implement different coding scenarios.

You rated this post out of 5. Change rating

2019-03-26 (first published: )

13,417 reads

Technical Article

RE: Multiple Data Files? Why?

  • Reply

As far as I know, multiple data files solve mainly problems with storage space. You can have each file on a different drive, so if the database is say 200GB (or you estimate that it will grow to such amount after some time), you can create 2 or 3 files - and then use 2 […]

You rated this post out of 5. Change rating

2004-08-05

Blogs

Small Data SF 2024

By

I can’t remember how I heard about Small Data SF 2024, but it caught...

A New Word: Moledro

By

moledro – n. a feeling of resonant connection with an author or artist you’ll...

Snowflake + Azure blob

By

Let’s go back to data platforms today and I want to talk about a...

Read the latest Blogs

Forums

7 sept, scheduled book

By philip.scott

Comments posted to this topic are about the item 7 sept, scheduled book

7 sept, schedlued article

By philip.scott

Comments posted to this topic are about the item 7 sept, schedlued article

6 sept, published book

By philip.scott

Comments posted to this topic are about the item 6 sept, published book

Visit the forum

Question of the Day

Azure Data Lake Storage Gen 2

Azure Data Lake Storage Gen 2 is built on ...?

See possible answers