From the course: Microsoft SQL Server 2022 Essential Training

Understand the role of T-SQL

- [Instructor] Structured Query Language, or SQL, is the language that we use to talk to our database server. The language has been around for a very long time, having been adopted by the American National Standards Institute, or ANSI, way back in 1986. Every relational database management system on the market today uses some form of the SQL language. Though some adhere to the standard syntax closer than others. Because Microsoft has built some unique and differentiating features into SQL Server, they've had to slightly modify the language away from strict ANSI compliance. Today, Microsoft's version of the language is called Transact-SQL or T-SQL. Everything that we've done so far in Management Studio has been performed on the server using the T-SQL language. Here's an example of the code that builds the same orders table that we added to the Red30 Tech database. When we build the table using the graphical design interface, Management Studio converts those instructions into this code for us behind the scenes. At some point, it just makes sense to take our skills beyond the tools presented in the graphical user interface and start writing this code ourselves. That's what this chapter is all about. Before we jump in though, I'd like to point you to this Transact-SQL reference documentation. I highly recommend that you bookmark this page as you'll want to refer to it early and often. Whenever you have a question about writing a T-SQL statement, this reference should be your first stop. On the left side of this page are different chapters within the documentation that will help you reference specific topics. Specifically, if I scroll down here, I can find this section on queries and open that up. This section will cover many of the clauses that we'll see over the next few movies to ask questions about your data. There's also a section on functions. Let me go ahead and scroll up to that. This will document how to use the built-in functions that perform calculations within the database or return information from the server. For instance, if I scroll through the function section and get to the date time functions, and expand that, and come down and find the function for GETDATE, we'll see how to use this specific function to return the system date and time from the database. We used this function when we created the timestamped default value in the Red30 Tech Products Table. So bookmark these pages. You'll want them easily accessible as you continue to work with SQL Server.

Contents