---
title: "How to create local temporary  table in Sqlserver."  
description: "How to create local temporary  table in Sqlserver."  
author: "Anonymous User"  
published: 2015-10-30  
updated: 2015-10-30  
canonical: https://www.mindstick.com/forum/33543/how-to-create-local-temporary-table-in-sqlserver  
category: ".net"  
tags: ["sql server"]  
reading_time: 1 minute  

---

# How to create local temporary  table in Sqlserver.

Can [anyone](https://www.mindstick.com/articles/23207/how-to-find-the-best-fit-job-for-anyone) please help me how to [solve this problem](https://answers.mindstick.com/qa/94681/my-google-assistant-shows-completely-different-search-results-from-what-i-ask-how-can-i-solve-this-problem).

## Replies

### Reply by Anonymous User

SQL Server provides the concept of temporary table which helps the developer in a best way. These tables can be created at runtime and can do the all kinds of operations that one normal table can do. But, based on the table types, the scope is limited. These tables are created inside tempdb database. Local temp tables are only available to the current connection for the user; and they are automatically deleted when the user disconnects from instances. Local temporary table name is stared with hash ("#") sign.\
**--step 1 create local temporary table** \

```
CREATE TABLE #temptbl( OrderID int, Orderdate datetime,
 amount decimal(10,2)   );
--step-2 insert data in #temptabl from order table insert into #temptbl select * from [Order]
--step-3 select data from #temptablselect * from #temptbl
```

```

```


---

Original Source: https://www.mindstick.com/forum/33543/how-to-create-local-temporary-table-in-sqlserver

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
