Missing Object Error from Profiler to Insert Newly Create TablePosted: June 14, 2017
When you insert rows immediately after the table creation, you may find there is an exception report for missing object if you dig into Profiler to view it. It is working fine from front end but you still see this error report. This behavior is caused by “deferred name resolution” and you will see this behavior with stored procedure as well.
Here is the code that generates this exception:
create table #temp (id int) insert into #temp (id) values (1)
You can avoid this error report by using different batch for your creation and insert.
create table #temp (id int) Go insert into #temp (id) values (1) Go
Or use global temp table
create table ##temp (id int) insert into ##temp (id) values (1)
Or do nothing and keep coding.