Skip to main content

Posts

Featured

What is Temporary Tables and Table Variables

Temporary Tables Temporary tables are created in tempdb.  The name "temporary" is slightly misleading, for even though the tables are instantiated in tempdb, they are backed by physical disk and are even logged into the transaction log.  They act like regular tables in that you can query their data via SELECT queries and modify their data via UPDATE, INSERT, and DELETE statements.  If created inside a stored procedure they are destroyed upon completion of the stored procedure.  Furthermore, the scope of any particular temporary table is the session in which it is created; meaning it is only visible to the current user.  Multiple users could create a temp table named #TableX and any queries run simultaneously would not affect one another - they would remain autonomous transactions and the tables would remain autonomous objects.  You may notice that my sample temporary table name started with a "#" sign.  This is the identifier for SQL Server that ...

Latest posts

How to execute SQL statements saved in a table with T-SQL

How to run dot SQL file from sqlcmd

SQL SERVER – TempDB is Full

Processes Blocking on SQL servers

Error in accessing availability replica in Always on environment

If ldf got corrupted or Database went into inRercovery.Then steps needs to follow.

Procedure for removing duplicate records

What is transaction in sql server ?? Why it is needed??

What is Update Stats

List of Jobs created @ time of replication setup