• Charmer (6/23/2016)


    Hi Friends,

    I had a question during my interview, as saying that What could be the reason when I am trying to drop all these tables , views, functions, SP's ...that few are dropped and few are not?

    Tables : Table1, Table 2 , Table 3

    View : View1, View2, View3

    SP : SP1, SP2 , SP3

    Function : Fn1, Fn2, Fn3

    Just curious to know.

    Any suggestions would be appreciated. Thanks in advance.

    I would think that most of the time would be because of dependencies even if WITH SCHEMABINDING isn't included in the problem. Another reason could be that the object is currently in use and will not drop until usage completes. Depending on several things, the system may just wait in a temporary "blocked" mode for the object to go "out of use" and then drop it.

    The same holds true for certain settings. For example, if xp_CmdShell is being used, setting it to "Disabled" will wait until current usage completes.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)