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

    go

    if object_id('test') is not null

    drop proc test

    go

    --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

    as

    print 'a'

    go

    --did we create it?

    exec dbo.test

    go

  • 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

    steve@dkranch.net

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

    Andy

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

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