From the course: Microsoft SQL Server 2022 Essential Training
Unlock this course with a free trial
Join today to access over 24,100 courses taught by industry experts.
Use the T-SQL editor - SQL Server Tutorial
From the course: Microsoft SQL Server 2022 Essential Training
Use the T-SQL editor
- [Teacher] Management Studio's Code Editor has some features that will make writing commands in the TSQL language a little bit easier. In the Object Explorer window, we can quickly review the code that would be required to recreate some of our existing objects by using the right click menu. Find the DBO dot orders table in the Red30Tech database, right click on it, then choose script table as, create to new query editor window. That prompts me to reconnect to my database engine, I'll just say connect there, and it opens up the code in a new text editor window. This shows me exactly what it would take to recreate this exact table on our system. So let's read through the text, starting at the top. Here we have the use command and it says Use Red30Tech. This will make sure that the script executes in the proper database. On line number two, we have Go. The Go Command is used by SQL Server to execute all of the code above…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
Understand the role of T-SQL2m 40s
-
(Locked)
Use the T-SQL editor6m 49s
-
(Locked)
Create a table with T-SQL6m 33s
-
(Locked)
Solution: Create tables with T-SQL commands3m 46s
-
(Locked)
Add data to a table4m 58s
-
(Locked)
Solution: Add data with T-SQL commands3m 4s
-
(Locked)
Retrieve records with SELECT4m 3s
-
(Locked)
Solution: Query data in a database2m 7s
-
(Locked)
Filter returned results with WHERE3m 12s
-
(Locked)
Sort records2m 54s
-
(Locked)
Solution: Filter and sort data with a query4m 27s
-
(Locked)
Delete records from a table4m 31s
-
(Locked)
Update records in a table2m 3s
-
(Locked)
Solution: Remove and update records in a table6m 11s
-
(Locked)
Joining related tables4m 32s
-
(Locked)
Solution: Query information from related tables5m 33s
-
(Locked)
Remove a table from the database5m 7s
-
-
-
-
-
-