1 from sysobjects where [name]=object_name(a.[id]) and xtype <>''''S'''' ) and a.uid=user_id(@username) and [id]=object_id(@objectname) order by object_name(a.id)
select @rowcount=@@rowcount if @rowcount=0 begin select @rc=-10 print @username+'''' have not any objects authorization.'''' return @rc end end end end go exec usp_getObjectAuthor