FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
sql-scripts-remember/scripts/21_Temporary_Tables.sql at main · DishaniD/sql-scripts-remember · GitHub
DishaniD
/
sql-scripts-remember
Public
forked from
DataWithBaraa/sql-ultimate-course
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
sql-scripts-remember
/
scripts
/
21_Temporary_Tables.sql
Copy path
More file actions
More file actions
Latest commit
History
History
History
29 lines (26 loc) · 1.16 KB
Breadcrumbs
sql-scripts-remember
/
scripts
/
21_Temporary_Tables.sql
Copy path
File metadata and controls
29 lines (26 loc) · 1.16 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
==============================================================================
SQL Temporary Tables
-------------------------------------------------------------------------------
This script provides a generic example of data migration using a temporary
table.
=================================================================================
*/
/*
==============================================================================
Step 1: Create Temporary Table (#Orders)
==============================================================================
*/
SELECT
*
INTO
#
Orders
FROM
Sales
.
Orders
;
/*
==============================================================================
Step 2: Clean Data in Temporary Table
==============================================================================
*/
DELETE
FROM
#
Orders
WHERE
OrderStatus
=
'
Delivered
'
;
/*
==============================================================================
Step 3: Load Cleaned Data into Permanent Table (Sales.OrdersTest)
==============================================================================
*/
SELECT
*
INTO
Sales
.
OrdersTest
FROM
#
Orders;
Back
|
FazBrowse Home
|
New Git URL