Staging Table

Hi,

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

Thanks

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:

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.

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

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.

Thanks All,

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

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

Sounds like an interview question that you failed.