Programming Microsoft SQL Server with Transact-SQL

Write smarter code with Transact-SQL

The Programming Microsoft SQL Server with Transact-SQL teaches you to write T-SQL code in SQL Server. You’ll work with variables, loops, error handling, stored procedures, triggers and dynamic SQL. Boost your knowledge of practical programming skills, gaining the ability to automate tasks, manage data and enhance your day-to-day development work. 

Learning objectives
  • Declare and use variables 
  • Apply conditional logic and loops 
  • Work with cursors to process records 
  • Handle errors using TRY/CATCH 
  • Write stored procedures 
  • Create user-defined functions 
  • Use triggers effectively 
  • Write and secure dynamic SQL 

What you’ll learn

Enhance data manipulation and automation with T-SQL programming. Our expert instructors will teach you how to structure SQL programmes, use procedural logic, and handle everything from cursors to error trapping. All through practical exercises in our live labs. 

Foundation of T-SQL programming

Learn how procedural code is structured in Transact-SQL and build confidence in writing efficient, well-organised scripts. Explore how statement blocks work, learn how to control the flow of execution using conditional logic and loops, and understand how to document your code effectively with clear comments. These core concepts provide the foundations for more advanced techniques and prepare you to write code that is both readable and reliable. 

Conditional logic and loops

Develop the skills to master how your code behaves in different scenarios using conditional logic and loop structures. You’ll learn how to use IF/ELSE statements to direct the flow of your scripts, implement WHILE loops for repetitive tasks, and apply control commands like BREAK, CONTINUE, and WAITFOR to fine-tune execution. These tools help you write more responsive and adaptable SQL programs that handle logic with precision.  

Working with stored procedures

Build stored procedures that make your code more modular, reusable and secure. You’ll gain hands-on experience creating procedures with parameters, controlling what they return, and managing output for different use cases. Also, explore how to work with result sets and structure procedures to support performance and maintainability, an essential skill for professional database development. 

Creating user-defined functions

Discover how to write your own functions in T-SQL to streamline code and support reusability. Learn how to develop both scalar functions, which return single values, and table-valued functions, that return result sets. These techniques help you write cleaner, more maintainable code while reducing duplication and improving clarity in your database operations. 

What’s included
  • 2 days of instructor-led training in a live virtual classroom 
  • Interactive hands-on live labs 
  • All relevant course materials 
  • Course completion certificate 

Key facts

Ideal for

Developers and DBAs who want to go beyond querying and build effective SQL programmes in Microsoft SQL Server. 

Prerequisites

You should have some SQL knowledge and be confident writing queries. Prior coding experience will also be helpful, but is not essential 

Learning experience

Our experienced trainers and interactive labs create a focused, practical environment – so you can put theory into practice from day one. 

FAQs

This two-day course shows you how to use Transact-SQL for real-world programming in SQL Server. Learn variables, logic, procedures, triggers and more, in our live virtual classrooms. 

What can I do with variables in T-SQL?

Variables in T-SQL allow you to store and manipulate data within your scripts, enabling dynamic programming and better control over logic. You can use them to hold values, calculate results, and pass data between statements. On this course, you’ll learn how to declare and initialise variables, set and retrieve their values, and apply them in queries and updates. 

How do I use IF statements and loops in T-SQL scripts?

IF statements and loops control the flow of execution in your T-SQL scripts. IF...ELSE lets you run different code blocks depending on conditions, and WHILE loops repeat operations until a specified condition is met. You’ll also use commands like BREAK and CONTINUE to fine-tune flow. This course teaches you how to apply these control structures effectively, helping you write code that reacts to different scenarios and handles complex logic with ease.  

How do I write user-defined functions in T-SQL?

User-defined functions (UDFs) allow you to encapsulate logic into reusable components that return values, either as a single result (scalar) or as a table. They are ideal for simplifying queries and reducing repetition in your code. Our trainers will teach you how to create, test and use both scalar and table-valued functions in SQL Server, so you can write cleaner, more maintainable T-SQL scripts. 

What course comes next after completing Programming Microsoft SQL Server with Transact-SQL?

Once you’ve completed this course, you can build on your skills with the Advanced Querying Microsoft SQL Server with Transact-SQL course. It covers more complex querying techniques, performance tuning, and advanced use of joins, indexes and subqueries. The course is perfect for those learners looking to take their SQL expertise to the next level. 

Why study with StayAhead
96% customer satisfaction

We combine experience and passion to deliver training that meets the highest standards

30+ years’ experience

Industry-leading specialists delivering high-impact IT training  

Experiential instructor-led training

Courses are delivered by experienced instructors using hands-on, practical live labs 

We're here to help
Talk to our training specialists

Not sure which course meets your needs? Our expert advisors are here to guide you, offering clear, practical advice to help you choose the right training for your career or technical needs. 

Business transformation
Technical training for your team

Want to advance your team’s technical expertise? Our tailored IT training programmes combine expert instruction with practical, hands-on live labs for an immersive learning experience. Speak with one of our development consultants to design a solution that fits your business needs.

Quote request

Please complete the form to ensure your quote is accurate and we will contact you soon.

Page {{ step }} of 2

Back Next