• So putting all this together we have:

    select * from tempdb.sys.objects where object_id = OBJECT_ID('tempdb.dbo.#testvm')

    Hope I've not missed anything 🙂

    seems perfect to me....