Unable to show database objects error
Say that the server you are working on has a DB named NPI, but you don't have access to it. When you paste this code in to SSMS you will get an error.
SELECT 'X' AS NPI INTO #NPI SELECT * FROM #NPI NPI WHERE NPI.NPI IS NOT NULL
It even happens without a temp table:
SELECT * FROM msdb.dbo.backupfile NPI WHERE NPI.backed_up_page_count IS NOT NULL;
I'm not sure why it thinks that the NPI. in the query refers to a DB instead of to the alias, but it is annoying.