• Hi, I hope the above advice still holds true.:-)

    I have the same problem with my software application that creates a database and a bunch of SQL Agent jobs. By default these are created with the owner being the login associated with the account used to install the app. If the AD account is deleted later the login is 'orphaned'. Then the SQL agent jobs stop working, and there are problems creating new tables etc in the database.

    A successful workaround is to make 'sa' owner. This works even if the 'sa' login is disabled, which is default if 'Windows Authentication only' is enabled.

    The alternative to ‘sa’ would be to use a login associated with the application’s service account, but that may be problematic if that is deleted and replaced, and back to square one.

    Which is better?

    I have heard that some DBAs rename the ‘sa’ login. How do I find out what it is renamed to, so that the app installer can use that instead?

    Will the following query be guaranteed to work?

    select loginname from syslogins where sid=0x01

    IanG