Friday, March 9, 2012

Owner of the table

I've got this question:
Is it possible to assign the 'current owner' using a query like the
following one:

set current schema OWNER1 (in DB2 sql, this allow me to reference the tables
without an explicit indication of the owner (es: after this query I can
simply write 'Select * from dummy', instead of 'Select * from
OWNER1.dummy')).

Thank you
Federica"Federica T" <fedina_chicca@.N_O_Spam_libero.it> wrote in message
news:ckga73$t06$1@.atlantis.cu.mi.it...
> I've got this question:
> Is it possible to assign the 'current owner' using a query like the
> following one:
> set current schema OWNER1 (in DB2 sql, this allow me to reference the
> tables
> without an explicit indication of the owner (es: after this query I can
> simply write 'Select * from dummy', instead of 'Select * from
> OWNER1.dummy')).
> Thank you
> Federica

Not really - in MSSQL, it's considered good practice to always fully specify
the object owner. There is a SETUSER command which allows a sysadmin to
impersonate another user, but it's deprecated and it doesn't support Windows
authentication which is the preferred authentication method.

Simon|||"Simon Hayes" <sql@.hayes.ch> ha scritto nel messaggio
news:416bc568$1_3@.news.bluewin.ch...

> Not really - in MSSQL, it's considered good practice to always fully
specify
> the object owner. There is a SETUSER command which allows a sysadmin to
> impersonate another user, but it's deprecated and it doesn't support
Windows
> authentication which is the preferred authentication method.
> Simon

Thank you a lot!
Fede

No comments:

Post a Comment