What is T-SQL (Transact-SQL)

T-SQL (Transact-SQL)

T-SQL (Transact-SQL) is a programming language but more specifically it is an extension (enhancement) made by Microsoft and SAP Sybase to SQL (Structured Query Language) that in the simplest of terms provides a way for any user or analyst to query (retrieve) data from a database while also providing a way for a database professional (administrator or developer) to create a database, the components that make up a database, and to manage security access to a database.

The T-SQL (Transact-SQL) language can be categorized into 3 general groups:

  1. DML (Data Manipulation Language) – Used to modify or retrieve rows of data from a table.
    This type of statement involves keywords such as INSERT, UPDATE, DELETE, MERGE, SELECT
  2. DDL (Data Definition Language) – used to create or modify the structure of a database.
    This type of statement involve keywords such CREATE, ALTER, and DROP
  3. DCL (Data Control Language) – Used to control access to a database (security).
    This type of statement involves keywords such as GRANT, REVOKE, and DENY.

SQL (Structured Query Language) itself was adopted by both the American National Standards Institute (ANSI) and the International Standards Organization (ISO) in an effort to stabilize the language to a point where certain elements of the language become universal regardless of the platform you choose to place your database on. The most commonly recognized platforms are Microsoft SQL Server, Oracle Database, MySQL, IBM DB2 and SAP Sybase. Each of these platforms generally adhere to the standards set forth for the language but each of these database management systems also add their own extensions or “flavor” if you will to the language. This is why Microsofts “flavor” of SQL is called T-SQL while Oracles “flavor” is called PL/SQL.

One of the benefits of T-SQL is that it is comparatively very easy to learn to use by the everyday end user or analyst. It is described as a “declarative” language in that you simply write it almost as imply as you might speak it. You tell it what data you want without having to tell it “how” to go about getting what you want.

For example the following statement in Natural Speaking Language says to please SELECT the Firstname and Lastname  of the people in the Employees table whose Lastname is Smith and show them to me.

SELECT Firstname, Lastname
FROM Employees
WHERE Lastname = ‘Smith’

Pretty simple huh?  Of course it can be made much more complex than that and that is where taking a course in T-SQL can be of an enormous benefit. Providing you with the tools necessary for success in todays competitive market is our goal.

Parting Shot

I really enjoyed writing this and I hope you also enjoyed reading it while also learning a little bit in a very short amount of time.

~ I’m so happy  if I dropped my harp it would fall through the cloud.

Cheers

What is T-SQL (Transact-SQL)

 

Share the Knowledge

Leave a Reply