Home > Archive > ASE Database forum > April 2005 > Database Owner and Name









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Database Owner and Name
Stacy

2005-04-28, 8:26 pm

Hello,

Can anyone tell me how to retrieve the database name (the actual name of
it on the server) and the owner name for Sybase SQL Server? I am using an
ODBC connection.

Thanks,
Stacy


Mark A. Parsons

2005-04-28, 8:26 pm

To get the name of the dataserver (if it's been defined):

select @@servername

To get a list of databases and their owners:

sp_helpdb

If you're already using/in a database:

select db_name() -- get current database name

sp_helpuser dbo -- find out who owns the database
-- owner will be aliased to 'dbo'

Stacy wrote:

> Hello,
>
> Can anyone tell me how to retrieve the database name (the actual name of
> it on the server) and the owner name for Sybase SQL Server? I am using an
> ODBC connection.
>
> Thanks,
> Stacy


Stacy

2005-04-29, 9:25 am

Will the
select db_name()
work for all types of database users? (i.e. with all types of permissions?)

Thanks for all your help!

Take care,
Stacy


"Mark A. Parsons" <iron_horse@no_spam.compuserve.com> wrote in message
news:42714DD1.D799C0E2@no_spam.compuserve.com...
> To get the name of the dataserver (if it's been defined):
>
> select @@servername
>
> To get a list of databases and their owners:
>
> sp_helpdb
>
> If you're already using/in a database:
>
> select db_name() -- get current database name
>
> sp_helpuser dbo -- find out who owns the database
> -- owner will be aliased to 'dbo'
>
> Stacy wrote:
>
name of[color=darkred]
an[color=darkred]
>



Jeffrey R. Garbus

2005-04-29, 11:26 am

Yes, everybody can run that function.

"Stacy" <sdudas@lynchval.com> wrote in message
news:427234d8$3@foru
ms-1-dub...
> Will the
> select db_name()
> work for all types of database users? (i.e. with all types of

permissions?)
>
> Thanks for all your help!
>
> Take care,
> Stacy
>
>
> "Mark A. Parsons" <iron_horse@no_spam.compuserve.com> wrote in message
> news:42714DD1.D799C0E2@no_spam.compuserve.com...
> name of
using[color=darkred]

> an
>
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com