Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Content with tags Stairway Series, Advanced T-SQL Rss

   Items 1 to 7 of 7   
 

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

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.  Read more...
By Gregory Larsen 2015/06/24 | Source: SQLServerCentral.com | Category: stairway series
Rating: |  Discuss |   Briefcase | 4,087 reads

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

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.   Read more...
By Gregory Larsen 2015/05/27 | Source: SQLServerCentral.com | Category: stairway series
Rating: |  Discuss |   Briefcase | 6,855 reads

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

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.   Read more...
By Gregory Larsen 2015/05/06 | Source: SQLServerCentral.com | Category: stairway series
Rating: |  Discuss |   Briefcase | 4,664 reads

Stairway to Advanced T-SQL Level 3: Understanding Common Table Expressions (CTEs)

A CTE is a temporary result set defined by a simple query, and is used within the execution scope of a single INSERT, UPDATE, DELETE, or SELECT statement. In this article we will explore how to define and use CTE's.  Read more...
By 2015/03/18 | Source: SQLServerCentral.com | Category: stairway series
Rating: |  Discuss |   Briefcase | 11,517 reads

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

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.  Read more...
By Gregory Larsen 2015/01/28 | Source: SQLServerCentral.com | Category: stairway series
Rating: |  Discuss |   Briefcase | 11,500 reads

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

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.   Read more...
By Gregory Larsen 2014/04/02 | Source: SQLServerCentral.com | Category: stairway series
Rating: |  Discuss |   Briefcase | 9,694 reads

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

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.  Read more...
By Gregory Larsen 2014/03/19 | Source: SQLServerCentral.com | Category: stairway series
Rating: |  Discuss |   Briefcase | 8,887 reads
   Items 1 to 7 of 7   
 
Tags
t-sql (2)    
apply (1)    
common table expressions (cte) (1)    
cursors (1)    
pivot (1)    
temp tables (1)    
unpivot (1)    
views (1)