April 28, 2005 at 1:44 pm
how do you change the owner name on a stored procedure to another owner name?
Thanks ahead of time!
April 28, 2005 at 1:52 pm
From BOL:
EXEC sp_changeobjectowner [ @objname = ] 'object' , [ @newowner = ] 'owner'
April 28, 2005 at 3:36 pm
Line 1: Incorrect syntax near 'insert_test_1'.
insert_test_1 is the stored procedure name
I used {EXEC sp_changeobjectowner [ @objname = ] 'insert_test_1' , [ @newowner = ] 'jttested'}
What am I doing wrong?
Thanks!
April 28, 2005 at 3:58 pm
You appear to have left in the marks used within BOL to indicate how to write commands. Try:
EXEC sp_changeobjectowner 'insert_test_1', 'jttested'
Philip
April 28, 2005 at 4:02 pm
Server: Msg 15001, Level 16, State 1, Procedure sp_changeobjectowner, Line 38
Object 'insert_test_1' does not exist or is not a valid object for this operation.
yep tryed that before also and got this error when doing it this way. Not sure why when then stored procedure is insert_test_1.
Thanks!
April 28, 2005 at 5:27 pm
What is your original owner, dbo or someone else?
sp_changeobjectowner 'oldowner.sp', 'newowner'
April 28, 2005 at 9:45 pm
Doh! That's it exactly, you have to use two-part naming to specify the old owner of the object as well as the object--and, as Allen shows, enter just the new owner in the second parameter.
Philip
April 29, 2005 at 10:00 am
Also make sure the current database is the one that contains the stored procedure you're working with.
Greg
April 29, 2005 at 10:01 am
That was it you guys are great Thanks!
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply