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
 temp table

Author  Topic 

siumui
Yak Posting Veteran

54 Posts

Posted - 2012-03-23 : 13:43:39
Hello all.

What does ## means in the code below?

SELECT account
INTO ##late
FROM ....

I know # is used for temp table, but the example from above has 2 ## signs. Please explain.

Thank you

siumui

X002548
Not Just a Number

15586 Posts

Posted - 2012-03-23 : 13:45:37
## is a global temp tables that exists outside the scope of the spid it's created in

it's like halfway between a temp table and a permanent table

Why do you ask?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

siumui
Yak Posting Veteran

54 Posts

Posted - 2012-03-23 : 13:51:04
quote:
Originally posted by X002548

## is a global temp tables that exists outside the scope of the spid it's created in

it's like halfway between a temp table and a permanent table

Why do you ask?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/






Thank you for the explanation.
Because I don't know what it means and I'm learning in the process:-).
Please explain what do you mean by spid? Thanks.


siumui
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2012-03-23 : 13:54:44
SQL Server Process Id

Execute this in a SSMS Windo

sp_who2 active


Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

siumui
Yak Posting Veteran

54 Posts

Posted - 2012-03-23 : 14:10:42
quote:
Originally posted by X002548

SQL Server Process Id

Execute this in a SSMS Windo

sp_who2 active


Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/






Thank you.

siumui
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-03-23 : 20:01:54
see this to understand difference

http://databases.aspfaq.com/database/should-i-use-a-temp-table-or-a-table-variable.html

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -