Reputation: 31
We just created a solution with multiple data projects. We inherited the system and want to do a database cleanup but when we compile some of the databases we get the error that table, id etc does not exist and it occures where temp tables are created in stored procedures.
Let's say a stored proc creates a temp table and at the end drops it the compiler complains and says that the table does not exist (in the database schema). How can we work around this? Any settings I can't find?
Thanks in advance.
Upvotes: 3
Views: 2884
Reputation: 768
There is a bug filed in Microsoft Connect on this issue, and there is a workaround suggested: use table variables instead of temporary tables. So, use
declare @t table (ID int, Name nvarchar(100) )
insert into @t ...
instead of
create table #t (ID int, Name nvarchar(100) )
insert into #t ...
drop table #t
Upvotes: 2