DBO vs. as owner

  • This is what I have tried so far. It didn't work on SQL2k

    select suser_sname()

    --ensure no proc exists already

    if object_id('dbo.test') is not null

    drop proc dbo.test


    if object_id('test') is not null

    drop proc test


    --create proc - goal is to have it created w/dbo as owner

    --but w/out explicitly saying 'dbo.'

    --the account that used to run this cannot be a member of sysadmins

    create proc test


    print 'a'


    --did we create it?

    exec dbo.test


  • I did it with a table, just a simple create table Newtest( Myid int)

    and then checked information_schema.tables as well as EM. Both show the owner as dbo.

    Steve Jones


  • I tested earlier with SQL login as well. There really is no difference at the sysusers level anyway.


Viewing 3 posts - 16 through 17 (of 17 total)

You must be logged in to reply to this topic. Login to reply