Is there a way to change the database owner using sp_changedbowner stored proc without having to be executed in the current database?
I have a script that creates a database and suppose to change the db owner right after creation.
I cannot use the 'USE <Dbname> command because it requires a 'GO' before you can use the Database. I can't use 'GO' inside my stored procs otherwise all my variables will disappear.
Any idea?
I have a script that creates a database and suppose to change the db owner right after creation.
I cannot use the 'USE <Dbname> command because it requires a 'GO' before you can use the Database. I can't use 'GO' inside my stored procs otherwise all my variables will disappear.
Any idea?