SQL Server Interview Question #3

What is T-SQL?

SQL Server Fundamentals Junior Beginner

Detailed Explanation

T-SQL stands for Transact-SQL. It is Microsoft's extension of standard SQL and adds programming features such as variables, conditions, loops, error handling, transactions, stored procedures, and additional built-in functions.

These features allow developers to implement complex data-processing logic directly in SQL Server.

Code Example

DECLARE @TotalProducts INT;

SELECT @TotalProducts = COUNT(*)
FROM Products;

IF @TotalProducts > 100
    PRINT 'More than 100 products';
ELSE
    PRINT '100 or fewer products';