Lesson 22. Programming with T-SQL

Although T-SQL is not a general-purpose programming language, it does support programming constructs such as variables and conditional processing. Because these will be used in the next few lessons, this lesson introduces these T-SQL programming concepts.

Understanding T-SQL Programming

All of the SQL statements used thus far have been single standalone statements—SELECT statements to retrieve data, ALTER TABLE statements to make table changes, and so on. But some data-retrieval tasks are more complex, often involving multiple statements, conditional processing, and mid-process data manipulation.

T-SQL is not a general-purpose programming language, but it does support some basic programming ideas and constructs ...

Get Sams Teach Yourself Microsoft® SQL Server T-SQL in 10 Minutes, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.