Object binding

  • Stewart "Arturius" Campbell (8/15/2013)


    Good back-to-stored proc basics question.

    +1 🙂

    Thanks
    Vinay Kumar
    -----------------------------------------------------------------
    Keep Learning - Keep Growing !!!

  • Very good question....

    There is a lil confusion to me....

    When the second batch gets executed the Stored procedure created successfuly, as according to deferred name resolution process when an entry is made in a sys.sql_modules in which an object is used in a SP that is not existed, SP will get create successfully...

    Now, while 3 batch gets executed, it does not the throw error and gets executed successfully as condition (1<>1) never gets executed. So, Does at the time of compilation only valid condition gets compiled and rest remained untouched?

    While executing 4 batch, I read somewhere that after getting an entry into a sys.sql_module if we create an non existing object in a stored procedure it will give you an error as now it will check that all objects using in a SP exists or not....

    _______________________________________________________________
    To get quick answer follow this link:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

  • Good question, but do agree the explanation could be improved.

  • Great question. 2) and 4) should give a warning about the nonexistent table, but will run nevertheless.

    I don't understand why 5% of the answers don't include the first option. I mean why would the create table statement not succeed :blink:?

  • Tough time!!!!! 😉

  • Easy question for me. Experience paid for me. 🙂

Viewing 6 posts - 16 through 21 (of 21 total)

You must be logged in to reply to this topic. Login to reply