Create Table From SELECT statement | SQL Server Tutorial
In this tutorial we look at how to create a SQL table from a SELECT statement.
Benefits
Its a really handy method if you want to duplicate a table structure, its seen sometimes with staging tables or as an alternative to temp tables and table variables. Personally I've only seen it used within stored procedures. Its a quick method to create a table rather than creating all the data types.
A big benefit is sometime where you just want some of the data from table a placed into table b. Maybe you might be recovering data for example
Is it good practice
In reality, its better practice to just create a table properly if you want a static table, if you only needed it temporarily, then I'd suggest using temp tables or table variables
Content
00:00 Introduction
00:27 Create table from SELECT
01:12 Primary Keys and constraints
01:54 Creating Table Objects
02:28 Inserting filtered data
Видео Create Table From SELECT statement | SQL Server Tutorial канала The SQL Guy
Benefits
Its a really handy method if you want to duplicate a table structure, its seen sometimes with staging tables or as an alternative to temp tables and table variables. Personally I've only seen it used within stored procedures. Its a quick method to create a table rather than creating all the data types.
A big benefit is sometime where you just want some of the data from table a placed into table b. Maybe you might be recovering data for example
Is it good practice
In reality, its better practice to just create a table properly if you want a static table, if you only needed it temporarily, then I'd suggest using temp tables or table variables
Content
00:00 Introduction
00:27 Create table from SELECT
01:12 Primary Keys and constraints
01:54 Creating Table Objects
02:28 Inserting filtered data
Видео Create Table From SELECT statement | SQL Server Tutorial канала The SQL Guy
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
![How To Use Foreach In Powershell. Easy Powershell Beginner Tutorial](https://i.ytimg.com/vi/Nw4nkRcrfxI/default.jpg)
![SQL Create Table With Primary Key | IF NOT EXISTS](https://i.ytimg.com/vi/HqKVwa6MdUA/default.jpg)
![How to find 4th Highest Salary from a table in SQL Server | Windowing Functions | Row Number](https://i.ytimg.com/vi/9WPs-rUW5G4/default.jpg)
![Understanding Filtered Indexes in SQL Server | Performance Tuning | SQL Training](https://i.ytimg.com/vi/mgGxg5oHwAE/default.jpg)
![SQL LIKE OPERATOR - A BEGINNER SQL SERVER TUTORIAL](https://i.ytimg.com/vi/J2VY6R3slLw/default.jpg)
![The Count Function SQL Tutorial](https://i.ytimg.com/vi/AiIgdJka-Mg/default.jpg)
![How To Restore a Database to SQL Server](https://i.ytimg.com/vi/QP87IKaNhM0/default.jpg)
![Delete Duplicate Rows in SQL Table](https://i.ytimg.com/vi/aUXDgF73qyY/default.jpg)
![How to Create Computed Columns in SQL Server (Step-by-Step) | Easy Beginners Tutorial](https://i.ytimg.com/vi/EPiaAanqRaU/default.jpg)
![How To Execute a SQL Script from Powershell](https://i.ytimg.com/vi/iqQTaJRwN2U/default.jpg)
![How To Partition In SQL Server | Tutorial | SQL Partition By Date](https://i.ytimg.com/vi/LRYDt9qjjq0/default.jpg)
![Learn SQL Functions in 10 Minutes | Easy SQL Tutorial](https://i.ytimg.com/vi/m7qxl-XTo9M/default.jpg)
![SQL Partition Table | Quick Tutorial | Partition By Date](https://i.ytimg.com/vi/q06fH80w7Os/default.jpg)
![How To Comment Out Code In Powershell. Easy Beginner Lesson](https://i.ytimg.com/vi/e2jmS8mpIr4/default.jpg)
![HOW TO USE SQL BETWEEN WITH DATES AND NUMBERS - EASY SQL TUTORIAL FOR BEGINNERS](https://i.ytimg.com/vi/505fiOV0Qyg/default.jpg)
![How To Use The SQL Equals Operator. A complete beginners lesson on how to use SQL Server](https://i.ytimg.com/vi/ZVjMhnBWvGQ/default.jpg)
![SQL Create Login and User in SQL Server | Grant and Deny Permissions](https://i.ytimg.com/vi/18nbqghpmz8/default.jpg)
![How To Use XEvents Profiler (Extended Events vs SQL Profiler)](https://i.ytimg.com/vi/emFZXVXfJOc/default.jpg)
![Reset sa Password in SQL Server](https://i.ytimg.com/vi/7PuwSMC6MTg/default.jpg)
![Powershell Get ChildItem - A Beginners lesson](https://i.ytimg.com/vi/UDqSSMlvpZc/default.jpg)