SQL Server Temporary Table types : Variable, Local and Global. Learn the features and availability.

preview_player
Показать описание
In this video you will learn about 3 different types of temporary table.

Table Variable
Local Temporary Table
Global Temporary Table

How to utilize temporary tables of the right kind in Microsoft SQL Server.

You will learn about how scope is used to confine each type.

Understanding which temporary table types are available will help you with your SQL development.

Global vs Local temporary tables.

Global Temporary Tables vs Local temporary tables.

Learn the difference between local temp tables and global temp tables.

How to declare a table variable.

Where are Global Temporary tables created.

Can two users use the same temporary table?

9 things you should know about temporary tables:
1) Temporary tables in SQL Server are used to store and process temporary data.

2) They are created in the tempdb database and are only visible to the current session.

3) Temporary tables can be either local or global. Local temporary tables are only visible to the current session, while global temporary tables are visible to all sessions.

4) Temporary tables are automatically dropped when the session that created them ends.

5) You can create a temporary table using the CREATE TABLE statement, with the addition of the TEMP or TEMPORARY keyword.

6) Temporary tables can have the same structure as regular tables, including constraints, indexes, and triggers.

7) You can insert, update, and delete data from temporary tables in the same way as regular tables.

8) You can use SELECT, JOIN, and other SQL statements to query data from temporary tables.

9) Temporary tables can improve query performance by allowing you to store intermediate results and avoid complex subqueries.

10) You should be careful when using temporary tables, as they can cause performance issues if not used properly. For example, excessive use of temporary tables can lead to tempdb contention and decreased performance.

Try again

#softwarenuggets, #sqlserver , @softwareNuggets
Рекомендации по теме
Комментарии
Автор

This is a very helpful video. Your examples taught me how to use each table type.

lifeofjay