February 23, 2011 at 8:23 am
Hi,
How to the data type of columns in #temporary tables and other info on #temp tables?
Thanks!
February 23, 2011 at 8:48 am
You can get that from the system views and DMVs in tempdb.
For example, select from tempdb.sys.columns to get column and datatype data about temp tables.
select *
from tempdb.sys.columns
where object_id = object_id(N'tempdb..#MyTempTable');
That'll give you column data about a temp table named #MyTempTable.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
February 27, 2011 at 4:11 pm
If you have a session that created a Temp Table, just do the following without closing the session and without changing sessions (windows in SSMS)...
EXEC TempDB..sp_help #nameoftemptable
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply