BY TOPIC
PROGRAMMING BLOGS
T-SQL BLOGS
BLOGS BY AUTHOR
BLOGS BY YEAR
Wise Owl Training - T-SQL blogs (page 1 of 3)
Showing blogs 1-20 (out of 56)
In SSMS, how to add multiple aliases to tables using the ALT key
Posted by Andy Brown on 23 March 2016
It's only a small thing, but … this blog shows how you can click and drag with the ALT key held down, then type to apply a table alias to lots of tables simultaneously.
Common Table Expressions are even better than I'd realised, as this blog shows
Posted by Andy Brown on 01 February 2016
CTEs (or Common Table Expressions) allow you to divide complicated queries up into two or more simple discrete tasks, as this blog explains.
A short blog listing many ways to create aliases for columns in SQL
Posted by Andy Brown on 01 February 2016
It's not often that this owl learns new things about SQL when giving a course, but when I do, I like to share my new knowledge! This blog shows a new way to create aliases for columns in SQL.
Posted by Andrew Gould on 09 June 2014
Using the Pivot operator in SQL Server allows you to create basic pivot tables from your query results. This blog teaches you how to create simple, static pivots, crosstab-style tables and exciting, dynamic pivot tables.
Posted by Andrew Gould on 27 November 2013
Triggers are special stored procedures that execute automatically in response to certain events in a database. This blog explains how to create three types of trigger in SQL Server: DML, DDL and Logon triggers.
Posted by Andrew Gould on 11 October 2013
This blog examines how to use Transactions in Microsoft SQL Server to allow you to control when data changes are committed to the database. You'll also discover how you can rollback transactions, effectively giving you the chance to undo changes to your data.
How to use the LAG and LEAD functions included in SQL Server 2012
Posted by Andy Brown on 20 September 2013
SQL Server 2012 introduces new functions to find the previous or subsequent value for a row, without using a complicated self-join. This blog explains how to use LAG and LEAD, including partitioning row sets.
Wise Owl suggestions for new features for SQL Server Management Studio
Posted by Andy Brown on 09 September 2013
Writing SQL in Management Studio could, Wise Owl feel, be made a little easier: here are 10 practical suggestions for how!
How to debug T-SQL queries and stored procedures
Posted by Andy Brown on 06 June 2013
This blog gives the low-down on how to start and use the debugger included in SQL Server Management Studio 2008 R2 and SSMS 2012.
Deleting and Updating Records in SQL
Posted by Andrew Gould on 08 May 2013
This blog teaches you how to modify existing data in your database by either deleting records or updating them.
How error messages work in SQL (including TRY, CATCH, RAISERROR and THROW)
Posted by Andy Brown on 03 May 2013
You can use BEGIN TRY to trap errors from SQL Server 2005 onwards, and also raise your own errors using RAISERROR or THROW - this blog explains all!
Using OUTER and CROSS APPLY joins to link to table-valued functions
Posted by Andy Brown on 03 May 2013
For the sake of completeness, this blog explains how to join to the results of table-valued functions (like a correlated subquery on steroids).
Output Parameters and Return Codes in SQL Server
Posted by Andrew Gould on 26 April 2013
This blog teaches you how to return values from your SQL stored procedures using two different techniques: return codes, and output parameters.
Posted by Andrew Gould on 22 April 2013
Dynamic SQL is a technique for building valid SQL statements from separate pieces of text. You can use this technique to create remarkably flexible and useful queries, as long as you're aware of the potential danger of SQL injection attacks.
Posted by Andrew Gould on 08 April 2013
A derived table is a technique for creating a temporary set of records which can be used within another query in SQL. You can use derived tables to shorten long queries, or even just to break a complex process into logical steps.
Posted by Andrew Gould on 26 March 2013
Cursors allow you to step through a set of data one record at a time. They’re not the quickest tool in SQL Server’s box, but they have their uses and this blog explains how they work.
Posted by Andrew Gould on 18 February 2013
Many programming languages feature a variety of types of loop which allow your programs to repeat a set of instructions multiple times. In SQL there is only one type of loop, and this blog explains how it works!
Inline and multi-statement table-valued functions
Posted by Andy Brown on 08 February 2013
This blog shows you how to create table-valued functions in SQL (ie functions which return a table of data!).
How to create and use table variables in T-SQL
Posted by Andy Brown on 08 February 2013
Table variables allow you to hold rows of data in temporary storage, without any processing overhead. Read this blog to add this technique to your SQL armoury!
Exporting data from SQL Server Management Studio
Posted by Andrew Gould on 04 February 2013
While SQL Server Management Studio is a powerful tool for writing queries, it has absolutely no concessions towards making the results of those queries remotely presentable! This blog describes several techniques for getting the results of a query into another application so that you can format them to your heart’s content.