Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    Regular Coder
    Join Date
    May 2009
    Location
    Moore, OK
    Posts
    282
    Thanks
    11
    Thanked 41 Times in 41 Posts

    Retrieving the column count of a temporary table?

    Is it possible to retrieve the column count of a temporary table. Basically I want to get it like this where I can check column names and data types. But I keep getting an error. Saying table doesn't exist, I believe because it is looking for the actual table not the temp one.

    Code:
    SELECT COUNT(*) 
    FROM `INFORMATION_SCHEMA`.`Columns` 
    WHERE `TABLE_NAME`='Split' && ((`COLUMN_NAME`='id' && `DATA_TYPE`='INT') || (`COLUMN_NAME`='value' && `DATA_TYPE`='TEXT') || (`COLUMN_NAME`='key' && `DATA_TYPE`='INT')) && `TABLE_SCHEMA`=@database
    Last edited by Coyote6; 02-16-2010 at 10:50 PM.


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •