• Andras Belokosztolszki (8/5/2008)


    One solution is to add the stored procedures to the master database, and add sp_ prefix to their names

    (bad practise)

    Another solution is to use a tool to sync the stored procedures between the various databases.

    Third solution is to use dynamic sql and use three part names like customerdb1.dbo.sometable

    None of the above solutions (maybe apart from the second) are nice though.

    Regards,

    Andras

    Actually, I don't think it is a bad practice to create a stored proc that resides in master. You just have to be careful in naming the proc so that you don't have to worry about Microsoft coming out with a system proc of the same name. A bad practice is naming procs with sp_ that reside in a user database, as SQL Server will first look to master then the user database.

    😎