Alsin
Alsin

Reputation: 1618

Deferred name resolution in UDF

Actually deferred name resolution is about tables in stored procedures. But I noted that sometime I CAN create UDF which refers to not-existent UDF, in other cases I CAN NOT. I didn't find any mention when not-existent UDF names allowed and when they are not.

It doesn't depend on UDF type (scalar/table-valued). Looks like if UDF returns XML it doesn't allow references to not-existent UDFs.

So I'm confused little bit. Is there any rules?

P.S. These views haven't been bound to the schema, no SCHEMABINDING

Upvotes: 0

Views: 298

Answers (1)

Damien_The_Unbeliever
Damien_The_Unbeliever

Reputation: 239704

The obvious reason why deferred name resolution wouldn't work is if the function is created with the "WITH SCHEMABINDING" option. Because this option causes entries to be made in the system tables, so that you cannot drop objects the function depends on, it will fail if the dependent object doesn't exist.

Upvotes: 2

Related Questions