• UMG Developer (6/9/2010)


    Nadrek (6/9/2010)


    B) Always use three part naming, so you either execute:

    Adventureworks.Person.(otherprefix)ReturnSomething

    or

    Master.dbo.(otherprefix)ReturnSomething

    both of which make it explicitly obvious what you're calling.

    That sounds nice, but it causes problems if for example you need to duplicate the DB to do testing, and don't have a different instance to put it in. Suddenly your SPs are running in the wrong DB, and you would have to go through and refactor all of the code. However, I do agree with using two part naming.

    True, "best practices" need to be evaluated in relation to any given situation and set of constraints one is under. As the situation and the constraints change, so too do the "best practices" that best fit.

    Since I've often dealt with systems that do a reasonable percentage of cross-database, same-instance calls, three part naming across the board makes sense; if you move to differently named database sets on the same instance, you're going to have to do a lot of careful global search and replace anyway.