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
 General SQL Server Forums
 New to SQL Server Programming
 difference in creating temporary table by #table and ##table

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-11-29 : 08:10:33
Banti writes "IF i create temporary table by using #table and ##table then what is the difference. i found no difference.
pls reply.
first:
create table ##temp
(
name varchar(25),
roll int
)
insert into ##temp values('banti',1)
select * from ##temp
second:
create table #temp
(
name varchar(25),
roll int
)
insert into #temp values('banti',1)
select * from #temp

both works fine , then what is the difference
waiting for ur reply
Banti"

ditch
Master Smack Fu Yak Hacker

1466 Posts

Posted - 2006-11-29 : 08:26:38
The temp table created using ## is available to all SPIDS logged on to the sqlserver instance whilst the creating session is still running and has not dropped that table. The one created with # is only available to the SPID that created it.

Duane.
Go to Top of Page
   

- Advertisement -