Unix Technical Forum

sys.tables starting with #

This is a discussion on sys.tables starting with # within the SQL Server forums, part of the Microsoft SQL Server category; --> Hello, if there are tables with names starting with a # I canīt look into them, e.g. by doing ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-29-2008, 07:27 PM
Mark
 
Posts: n/a
Default sys.tables starting with #

Hello,

if there are tables with names starting with a # I canīt look into them,
e.g. by doing "select * from tempdb.sys.tables". What is the reason for such
tables, who creates them and how I can see their content?

thanks and regards
Mark


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-29-2008, 07:27 PM
David Portas
 
Posts: n/a
Default Re: sys.tables starting with #

Mark wrote:
> Hello,
>
> if there are tables with names starting with a # I canīt look into them,
> e.g. by doing "select * from tempdb.sys.tables". What is the reason for such
> tables, who creates them and how I can see their content?
>
> thanks and regards
> Mark


Table names beginning with # are temp tables. They can be created like
any other but they reside in tempdb rather than the current database.
Try:

SELECT *
FROM tempdb.sys.tables
WHERE name LIKE '#%';

--
David Portas, SQL Server MVP

Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.

SQL Server Books Online:
http://msdn2.microsoft.com/library/m...S,SQL.90).aspx
--

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:09 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com