"Generate SQL Script" w/o setuser

  • We have a SQL 2000 database where, to release new stored procedures to

    the production database, our developers use the "generate sql scripts"

    function on the dev database to create a script to drop and create all

    the stored procedures, which they then run on the production database.

    This procedure automatically uses setuser statements to ensure the

    stored procedures are created with the correct owner. I've read this

    should be unnecessary as long as the create statement includes the

    owner name as part of the object name, which it always does.

    Is there any way to have these scripts generated without the setuser

    statements? I would like to lock down the server so our developers

    only have access to the database they work on, but since you have to be

    a member of the sysadmin role to use setuser, I can't do that unless I

    can figure out a way to get rid of it.

    Thanks for your help.

  • You're getting "SET USER" in your generated script ??     I never get that.  I just tried logging on as a "user", and I still don't get "SET USER"

  • There isn't a good way. You could centralize the scripts and just have the DBA or admin run the scripts as DBO, which removes the rights issue, but adds work to someone.

Viewing 3 posts - 1 through 2 (of 2 total)

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