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
2009-02-09 17:21:36
+1
A:
You can use the return value from sp_changeobjectowner. It returns 0 on success and 1 otherwise.
Learning
2009-02-09 17:22:38