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
 Check column type and size in temporary table?

Author  Topic 

truthseeker
Starting Member

15 Posts

Posted - 2010-09-27 : 10:15:41
I have a temporary table #MyTest created from an Excel spreadsheet via OPENROWSET.

How do I check a particular column's type and size of this temporary table?

Thanks in advance! :)

robvolk
Most Valuable Yak

15732 Posts

Posted - 2010-09-27 : 10:19:05
SELECT * FROM tempdb.INFORMATION_SCHEMA.COLUMNS WHERE OBJECT_ID('tempdb..' + table_name)=OBJECT_ID('tempdb..#myTable')
Go to Top of Page

truthseeker
Starting Member

15 Posts

Posted - 2010-09-27 : 10:51:24
Works great! Thanks!!!
Go to Top of Page
   

- Advertisement -