Can someone please explain why I can't retrieve a column of a temp table that I add after the creation of a temp table? This problem is only in 2000 and works fine in 2005 ...
SELECT TOP 1 * INTO #sysobjects FROM [dbo].[sysobjects]
ALTER TABLE #sysobjects ADD[schemaname] [VARCHAR] (48) NULL
DELETE FROM #sysobjects
INSERT INTO #sysobjects
EXEC('USE [master] SELECT *, USER_NAME(uid) FROM [dbo].[sysobjects] WHERE [type] = ''U''')
--SELECT * FROM #sysobjects
SELECT [schemaname] FROM #sysobjects
DROP TABLE #sysobjects
Now if you run the SELECT *, the schemaname column is definitely there ... I don't get it, and this is driving me crazy!!