Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Creating TempTable

Author  Topic 

ravi2k7
Starting Member

1 Post

Posted - 2008-11-07 : 03:55:24
Hi

RaviC

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-11-07 : 04:12:21
create table #t(i int)

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

thiyagu_rind
Starting Member

46 Posts

Posted - 2009-01-07 : 06:16:47
Hi Dear,

Temp table can be created by Local and Global. The Local temp table will has only one #. But the Global temp table will has two ## as the Global variable with @@.

Local Temp Table

CREATE TABLE #test(id int, name varchar(100)

Global Temp Table

CREATE TABLE ##test(id int, name varchar(100)


Regards
Thiyagarajan
Go to Top of Page

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-01-07 : 06:21:07
for table variable
Declare @table table(id int, name varchar(100))
Go to Top of Page

ashishashish
Constraint Violating Yak Guru

408 Posts

Posted - 2009-01-07 : 06:24:55
Create table #test(Uid int,Pname varchar(50))

Like this.....
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-07 : 09:39:02
also see this

http://databases.aspfaq.com/database/should-i-use-a-temp-table-or-a-table-variable.html
Go to Top of Page
   

- Advertisement -