Need debugging help--stored procedure to move database objects
hi all--i'm adapting stored procedure work on transferring sql server 2005 tables , other objects owned under dbo schema on database to another non-dbo schema. given that, i'm trying use "if...else" prevent dbo-owned stored procedures , tables dtproperties moving rest of objects non-dbo schema. here's code: if exists ( select * from sys.objects where object_id = object_id ( n '[dbo].[chobjowner]' ) and objectproperty ( object_id , n 'isprocedure' ) = 1 ) drop procedure [dbo] . [chobjowner] go set quoted_identifier off set ansi_nulls on go create proc chobjowner ( @usrname varchar ( 20 ), @newusrname varchar ( 50 )) as -- @usrname current user -- @newusrname new user set nocount on declare @uid int -- uid of user declare @objname varchar ( 50 ) -- object name owned user declare @currobjname varchar ( 50 ) -- checks existing object owned new user declare @outstr varchar ( 256 ) -- sql ...