Create Table From SELECT statement | SQL Server Tutorial

Veröffentlicht am: 13 September 2022
auf dem Kanal: The SQL Guy
5,437
19

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


Auf dieser Seite können Sie das Online-Video Create Table From SELECT statement | SQL Server Tutorial mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer The SQL Guy 13 September 2022 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 5,437 Mal angesehen und es wurde von 19 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!