Wednesday, February 15, 2012

Error 208, Missing Stats

Hi chaps

Just been having my head messed with...

I was running a trace capturing all errors and SQL. Had a bucket of
error 208's (invalid object name). Found the SQL that caused it - an
SP.

Ran the sp by hand, no messages come up - error 208 logged in the
trace.

Couldn't work it out. Then noticed stats missing on one column.
Created the stats manually - and suddenly the 208 error stops. Wtf?
Is this predicted/expected behaviour? Just me being a noob?

Thought I'd just share that. ta ;)
SQL2k, sp3a, w2k server.WangKhar (Wangkhar@.yahoo.com) writes:
> I was running a trace capturing all errors and SQL. Had a bucket of
> error 208's (invalid object name). Found the SQL that caused it - an
> SP.

Yes, this to be expected. This is because of deferred name resolution.
If the procedure creates temp tables, you'll get a lot of 208s. It could
be missing stastistics too. These are just signaled internally and inter-
cepted by some other module.

They are possibly of interest if they are causing recompiles for missing
tables, but then you should look for SP:Recompile instead.

And, true, missing statistics is another thing you could find. Then
again, with auto-statistics on, the statistics should come by time anyway.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Erland Sommarskog <sommar@.algonet.se> wrote in message
> Yes, this to be expected. This is because of deferred name resolution.

Ta.

No comments:

Post a Comment