T-SQL Programming with SQL Server

Course Description ( TSQ-66: a 2 day course )

This highly practical course is aimed at database developers or power users with existing SQL or T-SQL experience. It teaches how to utilize T-SQL's procedural extensions (variables, conditionals, looping and cursors) to develop solutions with Microsoft SQL Server's programming objects (stored procedures, triggers, views and user defined functions). Processing transactions, basic error handling and working with XML also feature. On completion, a comprehensive set of course notes, examples, tutor and attendee scripts are provided on a free USB pen drive to take away.

Suggested Prerequisites

Some prior SQL or T-SQL experience is assumed. Ideally, (though not mandatory), attendees will have either attended, or have the skill set from, Querying SQL Server with Transact SQL (T-SQL) , Introduction to Transact SQL (T-SQL), A Foundation in Transact SQL (T-SQL) or any of the SQL courses.


view pricing details here

Programming with Transact SQL (T-SQL)

  • About Batches, Statement Blocks and Procedures
  • SQL Server Programming Objects
  • Transact-SQL procedural extensions

Working with Views

  • Views Explained
  • Advantages of Views
  • Creating Views
  • Dropping Views
  • Modifying and Updating data with Views

Variables and Temporary Tables

  • The System Global Variables
  • Local Variables and Data Types
  • Declaring Local Variables
  • Assigning Values to Local Variables
  • Working with Temporary Tables
  • Using Table Variables
  • Table Variables vs Temporary Tables

Using Control of Flow Statements

  • Marking Code Blocks with BEGIN and END
  • Conditional Processing with IF...ELSE and GOTO
  • Using WHILE to Execute Statements Repeatedly
  • Using Break and RETURN to Exit Blocks and Procedures

Working with Cursors

  • About Cursors
  • ANSI and T-SQL Cursors
  • Declaring Cursors
  • Using Cursors

Developing Stored Procedures

  • About Stored Procedures
  • Stored Procedure Usage and Benefits
  • Creating Stored Procedures
  • Executing Stored Procedures
  • Passing values into Stored Procedures
  • Returning Data from Stored Procedures
  • Editing Stored Procedures
  • Building and Using User Defined Functions

Error Handling

  • Intercepting Errors with TRY ... CATCH
  • Obtaining Error Information
  • Using Error Functions
  • Responding to Errors

Transaction Processing

  • Introducing Transactions
  • Understanding Transaction Processing
  • Transactions and the SQL Server Log
  • Setting Up a Transaction Environment
  • Using ROLLBACK and Creating Save Points
  • Using Locks
  • Handling Transaction Errors
  • Committing Transactions
  • Transaction Tips

Enforcing Data Integrity with DML Triggers

  • Introducing Triggers
  • When to use Triggers
  • Types of Triggers: INSERT, DELETE, UPDATE, INSTEAD OF
  • Combining Trigger Types
  • Reporting Errors

On Site Requirements

Remember, we provide all equipment and software required to deliver a course at your premises. Aside from this, we need a suitably quiet and equipped room with enough work space for each attendee and a whiteboard or flipchart. Most courses involve the use of a PC projector and we bring our own. But either a projector screen, or usually just a clear wall, would be very helpful.

Other Courses to Consider

on site training courses available in:  

  • London
  • , Birmingham
  • , Edinburgh
  • , Manchester
  • , Scotland
  • , Glasgow
  • , Nottingham
  • , Midlands
  • , Bristol
  • , Wales
  • , Cardiff
  • , Dublin
  • , Belfast
  • , Leeds
  • , Liverpool
  • , Sheffield
  • , Reading
  • , Oxford
  • , Cambridge
  • , Southampton
  • , Newcastle
  • , Durham
  • , Warrington.

and across the UK and Ireland

email us now   or telephone:  01785 223253 
courses:    SQL    Transact SQL    SQL Server    Oracle SQL    IBM DB2    MySQL    PostgreSQL    XSLT    XML    XML Schema    VBScript    Full List
some customers:
  •  
  • public sector:
  •  
  • local authorities:
  •  
  •    flexible training    your venue or ours    London - Midlands - Scotland    and across the UK
     01785 223253
    instant written quotations
       development
     "Excellent course."
    (Home Office attendee)