//using C# 2005, MS SQL 2000(prod) and SQL Express 2005 (dev)
My sprocs all have a clearing mechanism at the end like this for each temporary table I use:
--drop temporary tables
IF EXISTS(SELECT name FROM [DBNAME]..sysobjects WHERE name = N'#Temp' AND xtype='U')
DROP TABLE #Temp
Every once in a while, something will happen to cause a hiccup and the table doesn't clear. The result is no results, not an error message (reader fails). I added the same code to the beginning of the procedure and it helped, but I didn't think that a temp table would persist in sysobjects. This happens from within using blocks in C# and I'm "sure" the connection is closed in code anyway.
Is this a known issue? I didn't really find anything similar in the msdn2 or sql areas.
TIA
_E
My sprocs all have a clearing mechanism at the end like this for each temporary table I use:
--drop temporary tables
IF EXISTS(SELECT name FROM [DBNAME]..sysobjects WHERE name = N'#Temp' AND xtype='U')
DROP TABLE #Temp
Every once in a while, something will happen to cause a hiccup and the table doesn't clear. The result is no results, not an error message (reader fails). I added the same code to the beginning of the procedure and it helped, but I didn't think that a temp table would persist in sysobjects. This happens from within using blocks in C# and I'm "sure" the connection is closed in code anyway.
Is this a known issue? I didn't really find anything similar in the msdn2 or sql areas.
TIA
_E
Comment