question

pits avatar image
pits asked

SQL 2000 Job failure

Good Day, I am using sql2000 standard edition. The job failed due to below error noticed under view job history. > Invalid object name 'dbo.Daar'. [SQLSTATE 42S02] (Error 208) Could not use view or function > 'ABC_d' because of binding errors. [SQLSTATE 42000] (Error 4413). The step failed. Can you please advise what is reason and meaning of the mentioned error? Rgds,
sql-server-2000joberror
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Cyborg avatar image
Cyborg answered
Make sure that your script inside job step is using the correct database. Update : As william suggested, make sure that the objects inside the view or function is not dropped. you can include SCHEMA_BINDING option in your views or functions so that you can prevent changes made on the referred objects by the view.
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

WilliamD avatar image WilliamD commented ·
Cyborg - the error talks about an invalid object but also mentions binding errors - this wouldn't appear if the query was run in the wrong database, you would just get the invalid object name and no further details.
2 Likes 2 ·
Cyborg avatar image Cyborg commented ·
+1 for good analysis. I agree william, sorry my fault.
0 Likes 0 ·
WilliamD avatar image
WilliamD answered
This error can mean that an object insde the view/function ABC_d has been dropped after the view/function was created. Example: /* create test objects*/ CREATE TABLE dbo.TableA (Col1 int NOT NULL); CREATE TABLE dbo.TableB (Col1 int NOT NULL); GO CREATE VIEW dbo.ABC_d AS SELECT a.Col1 TabA, b.Col1 TabB FROM dbo.TableA a INNER JOIN dbo.TableB b ON a.Col1 = b.Col1 GO ; /* select from test view - it works! */ SELECT * FROM dbo.ABC_d; /* drop one of the tables*/ DROP TABLE dbo.TableB; /* select from the view - it is now broken with binding errors*/ SELECT * FROM dbo.ABC_d; /* clean up the remaining objects*/ DROP VIEW dbo.ABC_d; DROP TABLE dbo.TableA;
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.