Introduction to Stored Procedures

  • Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/sburke/introductiontostoredprocedures.asp

  • Great article, but I'm having problems with who the owner should be in the CREATE PROCEDURE line.

    When I try to enter my own username as the owner, it shows an error message, and won't let me save the procedure. I have also tried 'dbo_user' with the same result.

    I've read elsewhere that the owner of the stored procedure should be the same as the owner of the objects it uses in order to avoid 'broken ownership chains'- whatever that is!

    Who should the user be?

  • Best practice is to have all objects owned by dbo. You can either create them and later change the owner, or you have to be the dbo (db owner) of the database. You can accomplish that either by connecting with any login that has sysadmin rights, or by setting up an alias for your login to dbo.

    Andy

  • Okay- that works. Thanks a lot.

  • Good introductory article. Will you be doing a follow-up article? I'd like to see one on using the T-SQL templates which aid in quickly creating standardised SP's.

    Thanks

    Phill Carter

    --------------------
    Colt 45 - the original point and click interface

Viewing 5 posts - 1 through 4 (of 4 total)

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