You need to reference the OBJECT_ID as the name is stored internally as a unique name. (it adds hidden characters).
Here's something you can run to see what I mean.
CREATE TABLE #foo (
[colA] INT
, [colB] INT
, [colC] VARCHAR(255)
)
-- This won't work
SELECT * FROM tempDb.information_Schema.columns WHERE [table_name] = '#foo'
-- This does work
SELECT * FROM tempDb.sys.columns WHERE [object_ID] = OBJECT_ID('tempDb..#foo')
DROP TABLE #foo
Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION