tags:

views:

74

answers:

2

I'm calling SQL's sp_changeobjectowner from C#. I want to check afterwards if it worked. How do I check if a table's owner is who I want it to be?

+1  A: 

This will get you the current owner name

select user_name(uid)
from sysobjects
where name = 'myTableName'
John MacIntyre
+1  A: 

You can use the return value from sp_changeobjectowner. It returns 0 on success and 1 otherwise.

Learning