SQLTeam.com | Weblogs | Forums

Staging Table


#1

Hi,

What is the Staging Table in Sql server and when do we need to create and use of it?

Thanks


#2

Do you refer to temp table? It will be needed if your requirement needs it :slight_smile:

It more if you only use it for a short period of time (only for that session), and you don't need it afterwards, then you can create a local temp tables.

question is too general and very hard to answer :slight_smile:


#3

In my experience,I have always used staging tables when dealing with ETL tasks.
Loading data from flat files to staging table.
Then performing transformations on staging table while loading the data to the base tables.


#4

Thanks dennisc and ahmeds.

Still confused. So staging table means for temporary use. After using does it delete or do I need to delete manually?
Where do I create local temp tables/staging tables?

Thanks


#5

A staging table can be a permanent table that is cleared before or after use.
As @ahmeds08 said it is used to "stage" data before insert into the actual table. Because of this we use a different database to hold the staging tables (not a T-SQL requirement to do it this way) to keep the production databases cleaner.


#6

Thanks All,

How do I load data from Flat File to staging table?


#7

SSIS (SQL Server Integration Services)
BCP Command Line "Bulk Copy Program" utility
or in a SQL statement BULK INSERT


#8

Sounds like an interview question that you failed.