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

Content with tags Stairway Series, T-SQL Rss

   Items 1 to 20 of 20   
 

Stairway to T-SQL: Beyond The Basics Level 9: Dynamic T-SQL Code

There times when you need to write T-SQL code that creates specific T-SQL Code and executes it. When you do this you are creating dynamic T-SQL code. When writing dynamic T-SQL you need to understand how dynamic code opens the possibilities for a SQL injection attack.  Read more...
By Gregory Larsen 2014/07/23 | Source: SQLServerCentral.com | Category: stairway series
Rating: |  Discuss |   Briefcase | 4,175 reads

Stairway to T-SQL: Beyond The Basics Level 7: Controlling the Flow of Your T-SQL

When you are writing TSQL code there are times when you want to perform the same logic over and over again. To accomplish this you can used the WHILE keyword. There are other times when you want to perform a conditional test and depending on the results of the test you execute one code block for the TRUE condition and possibly a different code block when the condition is FALSE. When you need to conditionally execute code based on the outcome of a condition you can used the IF keyword. In this Stairway level I will be discussing how to use the WHILE and IF constructs to control the flow of your TSQL code.  Read more...
By Gregory Larsen 2014/06/25 | Source: SQLServerCentral.com | Category: stairway series
Rating: |  Discuss |   Briefcase | 5,546 reads

Stairway to T-SQL: Beyond The Basics Level 6: Using the CASE Expression and IIF Function

There are times where you need to write a single T-SQL statement that is able to return different T-SQL expressions based on the evaluation of another expression. When you need this kind of functionality you can use the CASE expression or IIF function to meet this requirement. In this Stairway level Gregory Larsen reviews the CASE and IIF syntax and showing you examples of how the CASE expression and IIF function.  Read more...
By Gregory Larsen 2014/04/09 | Source: SQLServerCentral.com | Category: stairway series
Rating: |  Discuss |   Briefcase | 9,731 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 | 8,470 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 | 7,439 reads

Stairway to T-SQL: Beyond The Basics Level 3: Building a Correlated Subquery

This stairway level will expand on the subquery topic by discussing a type of subquery known as a correlated subquery, and explores what a correlated subquery is and how it is different from a normal subquery.  Read more...
By Gregory Larsen 2014/03/05 | Source: SQLServerCentral.com | Category: stairway series
Rating: |  Discuss |   Briefcase | 9,777 reads

Stairway to T-SQL: Beyond The Basics Level 1: The TOP Clause

The first topic in this stairway will be discussing the TOP clause. The TOP clause allows you to control the number of rows to be returned or affected by a query.  Read more...
By Gregory Larsen 2014/01/15 | Source: SQLServerCentral.com | Category: stairway series
Rating: |  Discuss |   Briefcase | 12,675 reads

Stairway to T-SQL: Beyond The Basics

Following on from his Stairway to T-SQL DML, Gregory Larsen covers more advanced aspects of the T-SQL language such as subqueries.  Read more...

Stairway to T-SQL DML Level 12: Using the MERGE Statement

The final level of this stairway looks at the MERGE statement in detail, focusing on how to perform insert, update and delete logic using the MERGE statement.  Read more...
By Gregory Larsen 2013/01/16 | Source: SQLServerCentral.com | Category: stairway series
Rating: |  Discuss |   Briefcase | 10,657 reads

Stairway to T-SQL DML Level 10: Changing Data with the UPDATE Statement

Unless you are working on a reporting-only application you will probably need to update tables in your SQL Server database. To update rows in a table you use the UPDATE statement. In this level we will be discussing how to find and update records in your database, and discuss the pitfalls you might run into when using the UPDATE statement.   Read more...
By Gregory Larsen 2012/10/10 | Category: stairway series
Rating: |  Discuss |   Briefcase | 6,637 reads

Stairway to T-SQL DML Level 11: How to Delete Rows from a Table

You may have data in a database that was inserted into a table by mistake, or you may have data in your tables that is no longer of value. In either case, when you have unwanted data in a table you need a way to remove it. The DELETE statement can be used to eliminate data in a table that is no longer needed. In this article you will see the different ways to use the DELETE statement to identify and remove unwanted data from your SQL Server tables.  Read more...
By Gregory Larsen 2012/09/19 | Category: stairway series
Rating: |  Discuss |   Briefcase | 9,669 reads

Stairway to T-SQL DML Level 9: Adding Records to a table using INSERT Statement

Not all applications are limited to only retrieving data from a database. Your application might need to insert, update or delete data as well. In this article, I will be discussing various ways to insert data into a table using an INSERT statement.  Read more...
By Gregory Larsen 2012/09/05 | Source: SQLServerCentral.com | Category: stairway series
Rating: |  Discuss |   Briefcase | 7,248 reads

Stairway to T-SQL DML Level 8: Using the ROLLUP, CUBE and GROUPING SET operator in a GROUP BY Clause

In this article I will be expanding on my discussion of the GROUP BY clause by exploring the ROLLUP, CUBE and GROUPING SETS operators. These additional GROUP BY operators make it is easy to have SQL Server create subtotals, grand totals, a superset of subtotals, as well as multiple aggregate groupings in a single SELECT statement.  Read more...
By Gregory Larsen 2012/08/22 | Category: stairway series
Rating: |  Discuss |   Briefcase | 11,108 reads

Stairway to T-SQL DML Level 7: Summarizing Data Using a Simple GROUP BY Clause

In this article you will be see how to group data using the simple GROUP BY clause, in order to summarize more complex data.  Read more...
By Gregory Larsen 2012/01/04 | Category: stairway series
Rating: |  Discuss |   Briefcase | 8,743 reads

Stairway to T-SQL DML Level 6: The Basics of Sorting Data Using the ORDER BY Clause

In this Level you will see how to use the ORDER BY clause to return your data in a sorted order.  Read more...
By Gregory Larsen 2011/12/14 | Category: stairway series
Rating: |  Discuss |   Briefcase | 8,207 reads

Stairway to T-SQL DML Level 5: The Mathematics of SQL: Part 2

Joining tables is a crucial concept to understanding data relationships in a relational database. When you are working with your SQL Server data, you will often need to join tables to produce the results your application requires. Having a good understanding of set theory, and the mathematical operators available and how they are used to join tables will make it easier for you to retrieve the data you need from SQL Server.  Read more...
By Gregory Larsen 2011/11/30 | Source: SQLServerCentral.com | Category: stairway series
Rating: |  Discuss |   Briefcase | 9,083 reads

Stairway to T-SQL DML Level 4: The Mathematics of SQL: Part 1

A relational database contains tables that relate to each other by key values. When querying data from these related tables you may choose to select data from a single table or many tables. If you select data from many tables, you normally join those tables together using specified join criteria. The concepts of selecting data from tables and joining tables together is all about managing and manipulating sets of data. In Level 4 of this Stairway we will explore the concepts of set theory and mathematical operators to join, merge, and return data from multiple SQL Server tables.  Read more...
By Gregory Larsen 2011/11/16 | Source: SQLServerCentral.com | Category: stairway series
Rating: |  Discuss |   Briefcase | 12,408 reads

Stairway to T-SQL Level 2: History of Structured Query Language (SQL)

Let’s step back in time and discuss the history of Structured Query Language, or what most SQL Server professionals just shorten to SQL. Fasten your seatbelts, crank up the time machine and travel back in time to follow the history of SQL and Microsoft SQL Server from its early years to where they are today.  Read more...
By Gregory Larsen 2011/10/21 | Source: SQLServerCentral.com | Category: stairway series
Rating: |  Discuss |   Briefcase | 8,036 reads

Stairway to T-SQL DML Level 1: The Basic SELECT Statement

There are lots of different aspects of managing data in a SQL Server database. Before you can get into the complex management issues associated with managing application data you need to start with the basic of retrieving data from a table. To return data from a SQL Server table you use a SELECT statement. In this level I will be cover the components of the basic SELECT statement and how you can use it to retrieve data from a single SQL Server table.  Read more...
By Gregory Larsen 2011/10/07 | Source: SQLServerCentral.com | Category: stairway series
Rating: |  Discuss |   Briefcase | 14,234 reads

Stairway to T-SQL DML

This Stairway will provide you with a basic understanding of how to work with data from SQL Server tables, using SQL Server’s Transact-SQL (T-SQL) dialect. DML is the Data Manipulation Language, and is the aspect of the language dealing with the data. It includes the statements SELECT, INSERT, UPDATE and DELETE. This Stairway will as also provide some history of the SQL language and some general concepts about set theory. Each level will build upon the prior level, so by the time you are finished you will have a good understanding of how to select and modify data from SQL Server.   Read more...
   Items 1 to 20 of 20   
 
Tags
advanced t-sql (2)    
dml (2)    
insert (2)    
math (2)    
case expression (1)    
correlated subqueries (1)    
cube (1)    
delete rows (1)    
dynamic t-sql code (1)    
grouping sets (1)    
history (1)    
iif (transact-sql) (1)    
join (1)    
merge (1)    
order by (1)    
rollup (1)    
select (1)    
temp tables (1)    
top (1)    
update (1)    
views (1)