Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

Object Browser in Query Analyzer
In Test environemnt user has access to DB1, they log in and in the drop down
box of DB names is DB1 but it does not appear in the object browser.
In Dev environemnt I do the same thing and the user can see DB1 in object
Browser.

This is driving me nuts, any help or advice appreciated

Thanks

Report this thread to moderator Post Follow-up to this message
Old Post
MANCPOLYMAN
01-28-06 01:23 AM


Re: Object Browser in Query Analyzer
ObjectBrowser uses sp_MShasdbaccess, so your security settings are not
identical between your two environments, maybe you are a sysadmin in one
case?

This is the proc so you can see the underlying query.
--  ====================
 ====================
=====
-- sp_MShasdbaccess
--  ====================
 ====================
=====
-- List all databases a user has access to
-- along with their db properties
--
-- PARAMETERS: N/A
--
-- REMARKS: for SQL Server 7.0 and 8.0
--  ====================
 ====================
=====
create proc sp_MShasdbaccess
as

set nocount on
set deadlock_priority low

select name as 'dbname',
owner =  substring(suser_snam
e(sid), 1, 24),
 DATABASEPROPERTY(nam
e, N'IsDboOnly') as 'DboOnly',
 DATABASEPROPERTY(nam
e, N'IsReadOnly') as 'ReadOnly',
 DATABASEPROPERTY(nam
e, N'IsSingleUser') as 'SingleUser',
 DATABASEPROPERTY(nam
e, N'IsDetached') as 'Detached',
 DATABASEPROPERTY(nam
e, N'IsSuspect') as 'Suspect',
 DATABASEPROPERTY(nam
e, N'IsOffline') as 'Offline',
 DATABASEPROPERTY(nam
e, N'IsInLoad')  as 'InLoad',
 DATABASEPROPERTY(nam
e, N'IsEmergencyMode') as 'EmergencyMode',
 DATABASEPROPERTY(nam
e, N'IsInStandBy') as 'StandBy',
 DATABASEPROPERTY(nam
e, N'IsShutdown')  as 'ShutDown',
 DATABASEPROPERTY(nam
e, N'IsInRecovery') as 'InRecovery',
 DATABASEPROPERTY(nam
e, N'IsNotRecovered') as 'NotRecovered'

from master.dbo.sysdatabases
where has_dbaccess(name) = 1
order by name
--  ====================
 ====================
=====
-- end sp_MShasdbaccess
--  ====================
 ====================
=====

GertD@SQLDev.Net

"MANCPOLYMAN" < MANCPOLYMAN@discussi
ons.microsoft.com> wrote in message
news:A35E3B8A-6A95-41D9-A42E- C31EB37A9063@microso
ft.com...
> In Test environemnt user has access to DB1, they log in and in the drop
> down
> box of DB names is DB1 but it does not appear in the object browser.
> In Dev environemnt I do the same thing and the user can see DB1 in object
> Browser.
>
> This is driving me nuts, any help or advice appreciated
>
> Thanks



Report this thread to moderator Post Follow-up to this message
Old Post
Gert E.R. Drapers
01-28-06 04:23 PM


Re: Object Browser in Query Analyzer
Gert,

Thanks a lot Gert, that helped.  I saw the owner was null v sa  I changed
the null to sa and restored that one but still the same.  Do i need to
reboot, stop/start, etc?

Again, many thanks.
MPM

"Gert E.R. Drapers" wrote:

> ObjectBrowser uses sp_MShasdbaccess, so your security settings are not
> identical between your two environments, maybe you are a sysadmin in one
> case?
>
> This is the proc so you can see the underlying query.
> --  ====================
 ====================
=====
> -- sp_MShasdbaccess
> --  ====================
 ====================
=====
> -- List all databases a user has access to
> -- along with their db properties
> --
> -- PARAMETERS: N/A
> --
> -- REMARKS: for SQL Server 7.0 and 8.0
> --  ====================
 ====================
=====
> create proc sp_MShasdbaccess
> as
>
> set nocount on
> set deadlock_priority low
>
> select name as 'dbname',
> owner =  substring(suser_snam
e(sid), 1, 24),
>  DATABASEPROPERTY(nam
e, N'IsDboOnly') as 'DboOnly',
>  DATABASEPROPERTY(nam
e, N'IsReadOnly') as 'ReadOnly',
>  DATABASEPROPERTY(nam
e, N'IsSingleUser') as 'SingleUser',
>  DATABASEPROPERTY(nam
e, N'IsDetached') as 'Detached',
>  DATABASEPROPERTY(nam
e, N'IsSuspect') as 'Suspect',
>  DATABASEPROPERTY(nam
e, N'IsOffline') as 'Offline',
>  DATABASEPROPERTY(nam
e, N'IsInLoad')  as 'InLoad',
>  DATABASEPROPERTY(nam
e, N'IsEmergencyMode') as 'EmergencyMode',
>  DATABASEPROPERTY(nam
e, N'IsInStandBy') as 'StandBy',
>  DATABASEPROPERTY(nam
e, N'IsShutdown')  as 'ShutDown',
>  DATABASEPROPERTY(nam
e, N'IsInRecovery') as 'InRecovery',
>  DATABASEPROPERTY(nam
e, N'IsNotRecovered') as 'NotRecovered'
>
> from master.dbo.sysdatabases
> where has_dbaccess(name) = 1
> order by name
> --  ====================
 ====================
=====
> -- end sp_MShasdbaccess
> --  ====================
 ====================
=====
>
> GertD@SQLDev.Net
>
> "MANCPOLYMAN" < MANCPOLYMAN@discussi
ons.microsoft.com> wrote in message
> news:A35E3B8A-6A95-41D9-A42E- C31EB37A9063@microso
ft.com... 
>
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
MANCPOLYMAN
01-31-06 01:23 AM


Sponsored Links





Last Thread Next Thread
Post New Thread

MS SQL Server archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 05:28 AM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006