Total Page Preview:   000000000100

What is temporary table in SQL in English and Hindi

Temporary table in SQL in Engilsh

In SQL, a temporary table is a table that is created and exists only for the duration of a database session. Temporary tables are used to store data temporarily, which can be used in subsequent queries or stored procedures. Once the database session ends, the temporary table is automatically deleted.

Temporary tables can be created in two ways: local and global. Local temporary tables are visible only to the session that creates them, and they are automatically dropped when the session ends. Global temporary tables are visible to all sessions and are dropped when the last session referencing them ends.
To create a local temporary table, you can use the following syntax:
 
To create a global temporary table, you can use the following syntax:
 
Once the temporary table is created, data can be inserted, updated, or deleted using standard SQL statements. After the database session ends, the temporary table is automatically deleted.
 
 
 

Temporary table in SQL in Hindi

SQL me temporary table ek aisi table hoti hai jo sirf database session ke dauran create ki jati hai aur session khatam hone ke baad automatically delete ho jati hai. Temporary table ka upyog data ko temporarily store karne ke liye kiya jata hai, jise dusre queries ya stored procedures me use kiya ja sakta hai.
 
Temporary table ke kuch important points hai:
  • Temporary table ka data session ke liye hi store kiya jata hai aur database restart hone par table delete ho jata hai.
  • Temporary table ka naam "#" (hash) symbol se shuru hota hai. Jaise ki, #TempTable.
  • Temporary table column ka data type aur size ke liye permanent table ki tarah schema define kiya jata hai.
  • Temporary table me data insert, update aur delete karne ke liye standard SQL statement ka upyog kiya jata hai.
Temporary table ke kuch upyog hai:
  • Temporary table ka upyog, complex queries ke liye intermediate data store karne ke liye kiya jata hai.
  • Temporary table ka upyog, batch processing ke liye kiya jata hai.
  • Temporary table ka upyog, data sharing ke liye different stored procedures ya user-defined functions ke beech me kiya jata hai.
Temporary table ko create karne ke liye, CREATE TABLE statement ka upyog kiya jata hai. Syntax is tarah se hota hai:

Is tarah se temporary table create karne ke baad, ise standard SQL statement ka upyog karke data insert, update ya delete kiya ja sakta hai.

 

 

 

Thank You

About Author

Brijesh Kumar

Database Developer

I have more then 6 years Experience in Microsoft Technologies - SQL Server Database, ETL Azure Cloud - Azure SQL Database, CosmosDB, Azure Data Factory, PowerBI, Web Job, Azure Function, Azure Storage, Web Apps, Powershall and Database Migration On-Premise to Azure Cloud.
LinkedIn : https://www.linkedin.com



Comments


                           
                           

                           

                           

Facebook User: