Showing posts with label management. Show all posts
Showing posts with label management. Show all posts

Monday, March 19, 2012

database management?

Hi to All,
I am working in vb and C# .net as front hand and use mySql or Squel server as back-hand.
task is, i did here it that, we have more than one table, each and every is related by using the concept of Primary and Foreign key management.
in that database if i remove a record from master table, than the related record of all child talbes shall auto-matically reoved that is my question how it does happen.
first thing that you have understood my problem if yes than please if you have any idea, mail me.
i will very much thnks in advance to you.
bye
regards Rajat.Moving to more appropriate forum.|||

In SQL Server you can either implement tzhis using your own logic by triggers or you use the built in automatically working functonality whic is called cascading delete. See more information about this in the Online help of SQL Server:

http://msdn2.microsoft.com/en-us/library/ms186973.aspx


Jens K. Suessmeyer.

-
http://www.sqlserver2005.de
-

Database management

Hi,
I want to import, export and backup databases through my application.
can anybody tell me the best way to program database management?
Thanx for any help!
HansEither use your favorite API (like ADO, ADO.NET etc) and just execute the SQ
L statements, like
BACKUP, BULK INSERT etc. Or use an API designed for this purpose, i.e., SQLD
MO. Just be aware that
DMO will be "replaced" by SMO in SQL Server 2005, so you might not want to i
nvest too much effort
into this API.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Hans" <Hans@.discussions.microsoft.com> wrote in message
news:45A47639-9166-4A33-91FE-C7EF7B35DFFC@.microsoft.com...
> Hi,
> I want to import, export and backup databases through my application.
> can anybody tell me the best way to program database management?
> Thanx for any help!
> Hans|||Hans,
Tibor makes a good point, however SQL-DMO *should* be backwards
compatible with SQL Server 2005. i.e. all SQL-DMO code should still
work, but will not support SQL Server 2005 features, only 2000/7 ones.
If you want SQL Server 2005 functionality then you would need to use SMO.
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Tibor Karaszi wrote:
> Just be aware that
> DMO will be "replaced" by SMO in SQL Server 2005, so you might not want to
invest too much effort
> into this API.
>|||Thanx for your suggestions!
Hans.
"Tibor Karaszi" wrote:

> Either use your favorite API (like ADO, ADO.NET etc) and just execute the
SQL statements, like
> BACKUP, BULK INSERT etc. Or use an API designed for this purpose, i.e., SQ
LDMO. Just be aware that
> DMO will be "replaced" by SMO in SQL Server 2005, so you might not want to
invest too much effort
> into this API.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Hans" <Hans@.discussions.microsoft.com> wrote in message
> news:45A47639-9166-4A33-91FE-C7EF7B35DFFC@.microsoft.com...
>
>

Database management

Hi,
I want to import, export and backup databases through my application.
can anybody tell me the best way to program database management?
Thanx for any help!
HansEither use your favorite API (like ADO, ADO.NET etc) and just execute the SQL statements, like
BACKUP, BULK INSERT etc. Or use an API designed for this purpose, i.e., SQLDMO. Just be aware that
DMO will be "replaced" by SMO in SQL Server 2005, so you might not want to invest too much effort
into this API.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Hans" <Hans@.discussions.microsoft.com> wrote in message
news:45A47639-9166-4A33-91FE-C7EF7B35DFFC@.microsoft.com...
> Hi,
> I want to import, export and backup databases through my application.
> can anybody tell me the best way to program database management?
> Thanx for any help!
> Hans|||Hans,
Tibor makes a good point, however SQL-DMO *should* be backwards
compatible with SQL Server 2005. i.e. all SQL-DMO code should still
work, but will not support SQL Server 2005 features, only 2000/7 ones.
If you want SQL Server 2005 functionality then you would need to use SMO.
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Tibor Karaszi wrote:
> Just be aware that
> DMO will be "replaced" by SMO in SQL Server 2005, so you might not want to invest too much effort
> into this API.
>|||Thanx for your suggestions!
Hans.
"Tibor Karaszi" wrote:
> Either use your favorite API (like ADO, ADO.NET etc) and just execute the SQL statements, like
> BACKUP, BULK INSERT etc. Or use an API designed for this purpose, i.e., SQLDMO. Just be aware that
> DMO will be "replaced" by SMO in SQL Server 2005, so you might not want to invest too much effort
> into this API.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Hans" <Hans@.discussions.microsoft.com> wrote in message
> news:45A47639-9166-4A33-91FE-C7EF7B35DFFC@.microsoft.com...
> > Hi,
> >
> > I want to import, export and backup databases through my application.
> >
> > can anybody tell me the best way to program database management?
> >
> > Thanx for any help!
> > Hans
>
>

Database management

Hi,
I want to import, export and backup databases through my application.
can anybody tell me the best way to program database management?
Thanx for any help!
Hans
Either use your favorite API (like ADO, ADO.NET etc) and just execute the SQL statements, like
BACKUP, BULK INSERT etc. Or use an API designed for this purpose, i.e., SQLDMO. Just be aware that
DMO will be "replaced" by SMO in SQL Server 2005, so you might not want to invest too much effort
into this API.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Hans" <Hans@.discussions.microsoft.com> wrote in message
news:45A47639-9166-4A33-91FE-C7EF7B35DFFC@.microsoft.com...
> Hi,
> I want to import, export and backup databases through my application.
> can anybody tell me the best way to program database management?
> Thanx for any help!
> Hans
|||Hans,
Tibor makes a good point, however SQL-DMO *should* be backwards
compatible with SQL Server 2005. i.e. all SQL-DMO code should still
work, but will not support SQL Server 2005 features, only 2000/7 ones.
If you want SQL Server 2005 functionality then you would need to use SMO.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Tibor Karaszi wrote:
> Just be aware that
> DMO will be "replaced" by SMO in SQL Server 2005, so you might not want to invest too much effort
> into this API.
>
|||Thanx for your suggestions!
Hans.
"Tibor Karaszi" wrote:

> Either use your favorite API (like ADO, ADO.NET etc) and just execute the SQL statements, like
> BACKUP, BULK INSERT etc. Or use an API designed for this purpose, i.e., SQLDMO. Just be aware that
> DMO will be "replaced" by SMO in SQL Server 2005, so you might not want to invest too much effort
> into this API.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Hans" <Hans@.discussions.microsoft.com> wrote in message
> news:45A47639-9166-4A33-91FE-C7EF7B35DFFC@.microsoft.com...
>
>

Sunday, March 11, 2012

Database Maintenance Plan Wizard

I cannot run the DB Maint. Plan Wizard, when I trying I get the following
error (right from the start):
TITLE: Microsoft SQL Server Management Studio
Cannot show requested dialog.
ADDITIONAL INFORMATION:
Unable to execute requested command.
Method not found: 'Void
Microsoft.SqlServer.Management.DatabaseMaintenance .TaskUIUtils..ctor()'.
(Microsoft.SqlServer.Management.MaintenancePlanWiz ard)
BUTTONS:
OK
I do have SSIS installed, and I can see that the service is running in the
SS Configuration Manager.
The version of SQL:
Microsoft SQL Server 2005 - 9.00.3042.00 (X64) Feb 10 2007 00:59:02
Copyright (c) 1988-2005 Microsoft Corporation Standard Edition (64-bit) on
Windows NT 5.2 (Build 3790: Service Pack 2)
Any help would be very much appreciated!
Wanted to include for details on install:
Microsoft SQL Server Management Studio9.00.1399.00
Microsoft Analysis Services Client Tools2005.090.1399.00
Microsoft Data Access Components (MDAC)2000.086.3959.00
(srv03_sp2_rtm.070216-1710)
Microsoft MSXML2.6 3.0 6.0
Microsoft Internet Explorer6.0.3790.1830
Microsoft .NET Framework2.0.50727.1433
Operating System5.2.3790
"Scott" wrote:

> I cannot run the DB Maint. Plan Wizard, when I trying I get the following
> error (right from the start):
>
> TITLE: Microsoft SQL Server Management Studio
> --
> Cannot show requested dialog.
> --
> ADDITIONAL INFORMATION:
> Unable to execute requested command.
> --
> Method not found: 'Void
> Microsoft.SqlServer.Management.DatabaseMaintenance .TaskUIUtils..ctor()'.
> (Microsoft.SqlServer.Management.MaintenancePlanWiz ard)
> --
> BUTTONS:
> OK
> --
>
> I do have SSIS installed, and I can see that the service is running in the
> SS Configuration Manager.
> The version of SQL:
> Microsoft SQL Server 2005 - 9.00.3042.00 (X64) Feb 10 2007 00:59:02
> Copyright (c) 1988-2005 Microsoft Corporation Standard Edition (64-bit) on
> Windows NT 5.2 (Build 3790: Service Pack 2)
> Any help would be very much appreciated!
|||RELOADED SP2, which seems to have fixed it.
"Scott" wrote:

> I cannot run the DB Maint. Plan Wizard, when I trying I get the following
> error (right from the start):
>
> TITLE: Microsoft SQL Server Management Studio
> --
> Cannot show requested dialog.
> --
> ADDITIONAL INFORMATION:
> Unable to execute requested command.
> --
> Method not found: 'Void
> Microsoft.SqlServer.Management.DatabaseMaintenance .TaskUIUtils..ctor()'.
> (Microsoft.SqlServer.Management.MaintenancePlanWiz ard)
> --
> BUTTONS:
> OK
> --
>
> I do have SSIS installed, and I can see that the service is running in the
> SS Configuration Manager.
> The version of SQL:
> Microsoft SQL Server 2005 - 9.00.3042.00 (X64) Feb 10 2007 00:59:02
> Copyright (c) 1988-2005 Microsoft Corporation Standard Edition (64-bit) on
> Windows NT 5.2 (Build 3790: Service Pack 2)
> Any help would be very much appreciated!

Database Maintenance Plan Wizard

I cannot run the DB Maint. Plan Wizard, when I trying I get the following
error (right from the start):
TITLE: Microsoft SQL Server Management Studio
--
Cannot show requested dialog.
--
ADDITIONAL INFORMATION:
Unable to execute requested command.
--
Method not found: 'Void
Microsoft.SqlServer.Management.DatabaseMaintenance.TaskUIUtils..ctor()'.
(Microsoft.SqlServer.Management.MaintenancePlanWizard)
--
BUTTONS:
OK
--
I do have SSIS installed, and I can see that the service is running in the
SS Configuration Manager.
The version of SQL:
Microsoft SQL Server 2005 - 9.00.3042.00 (X64) Feb 10 2007 00:59:02
Copyright (c) 1988-2005 Microsoft Corporation Standard Edition (64-bit) on
Windows NT 5.2 (Build 3790: Service Pack 2)
Any help would be very much appreciated!Wanted to include for details on install:
Microsoft SQL Server Management Studio 9.00.1399.00
Microsoft Analysis Services Client Tools 2005.090.1399.00
Microsoft Data Access Components (MDAC) 2000.086.3959.00
(srv03_sp2_rtm.070216-1710)
Microsoft MSXML 2.6 3.0 6.0
Microsoft Internet Explorer 6.0.3790.1830
Microsoft .NET Framework 2.0.50727.1433
Operating System 5.2.3790
"Scott" wrote:
> I cannot run the DB Maint. Plan Wizard, when I trying I get the following
> error (right from the start):
>
> TITLE: Microsoft SQL Server Management Studio
> --
> Cannot show requested dialog.
> --
> ADDITIONAL INFORMATION:
> Unable to execute requested command.
> --
> Method not found: 'Void
> Microsoft.SqlServer.Management.DatabaseMaintenance.TaskUIUtils..ctor()'.
> (Microsoft.SqlServer.Management.MaintenancePlanWizard)
> --
> BUTTONS:
> OK
> --
>
> I do have SSIS installed, and I can see that the service is running in the
> SS Configuration Manager.
> The version of SQL:
> Microsoft SQL Server 2005 - 9.00.3042.00 (X64) Feb 10 2007 00:59:02
> Copyright (c) 1988-2005 Microsoft Corporation Standard Edition (64-bit) on
> Windows NT 5.2 (Build 3790: Service Pack 2)
> Any help would be very much appreciated!|||RELOADED SP2, which seems to have fixed it.
"Scott" wrote:
> I cannot run the DB Maint. Plan Wizard, when I trying I get the following
> error (right from the start):
>
> TITLE: Microsoft SQL Server Management Studio
> --
> Cannot show requested dialog.
> --
> ADDITIONAL INFORMATION:
> Unable to execute requested command.
> --
> Method not found: 'Void
> Microsoft.SqlServer.Management.DatabaseMaintenance.TaskUIUtils..ctor()'.
> (Microsoft.SqlServer.Management.MaintenancePlanWizard)
> --
> BUTTONS:
> OK
> --
>
> I do have SSIS installed, and I can see that the service is running in the
> SS Configuration Manager.
> The version of SQL:
> Microsoft SQL Server 2005 - 9.00.3042.00 (X64) Feb 10 2007 00:59:02
> Copyright (c) 1988-2005 Microsoft Corporation Standard Edition (64-bit) on
> Windows NT 5.2 (Build 3790: Service Pack 2)
> Any help would be very much appreciated!

Sunday, February 19, 2012

Database Mail - Status sent but email never received

From SQL Management Studion I go to Management > Database Mail and I am trying to send a test email but I never receive anything. I checked my SMTP Mail Server Logs and I saw no entry of my test email.

I also I checked my SQL Database Mail Logs and everything seems fine, no errors are reported.

The msdb.dbo.sysmail_allitems shows my email status as "sent".

So what am I missing? What steps would you recommend for troubleshooting my problem?

Thank you,

Ric

Quick question if you are using Express if yes then your mail was not sent because the MSDN is home to the Agent and the Agent is not included with Express. Hope this helps.|||

No I am not using express, I am using the SQL Server 2005 standard version. Did I post at the wrong place?

Ric

|||

No you did not post in the wrong place but your problem is related to configuration and permissions. I have found two tutorials by SQL Server users check them to see what is missing in your configuration. Hope this helps.

http://www.sqlservercentral.com/columnists/cBunch/introtodatabasemailinsql2005.asp

http://www.databasejournal.com/features/mssql/article.php/3626056

|||

Thanks for your reply Gift. I did exactly what is mentionned in your articles however I get the exact same results. My test emails seems to be sent, no error message, status is mark as sent but no I see no trace of such email on the smtp server.

Issp_send_dbmail waiting for a reply from the SMTP server before to mark the email status as sent? Also if I had a problem of permission I guest I would have some kind of error? Same thing if the port 25 was block I guess?

Ric

|||

(msdb.dbo.sysmail_allitems)

The above from your original post tells me either you and the Agent or just one need permissions in the Server and MSDB database because I don't know why these things are not documented but most auxiliary automation tasks like mail runs out of the Agent database the MSDB database. So try that and post again if you still need help.

|||

Sorry Gift but you are loosing me hereConfused, I don't understand what you mean. If you think that I have a permission problem where should I look? Which permission and on what? How to give the proper rights if that is what's missing?

Thanks again,
Ric

|||

(Configuration component has two sub components. One is the Database Mail account, which contains information such as the SMTP server login, Email account, Login and password for SMTP mail.

The Second sub component is Database Mail Profile. Mail profile can be Public, meaning members of DatabaseMailUserRole in MSDB database can send email.)

I got the above from one of the links you need to create account both in your SQL Server and MSDB database and grant it DatabaseMailUserRole public role before your configuration will work. So go to the Security section under management in Management Studio and the new security section within MSDB to create the account with the right permissions. Hope this helps.

Friday, February 17, 2012

Database Login fails

Hi

I can logon to my Sql server using the SSMS management tool, I am using Windows Authentication to logon to SSMS. Create a database OK, with all the necessary tables.

However when I start a VB Express app and try to connect to this database I get an error that login filed for user AMD\Larry, AMD is my PC name and my login (Larry) is the computer Administrator logon. The PC is a standalone ie not part of a domain etc.

Can anyone help?

Regards.

Larry.

Hi Larry,

to solve you problem: in SSMS, connect to your database, go to Security, Logins, New Login, Add new login as AMD\Larry and give it right to access your database.

good luck

mario

|||Are you also using integrated Authentication in VB Express. Make sure that you don′t really *type* in the user as this will be recognized as a SQL Server login. Integrated login is done in the background and don′t have be typed in somewhere (I also mention that becasue many people are always confused about that)


HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

|||Thanks for these I wil try them and get back.

Tuesday, February 14, 2012

Database List Hardcoded into SQL Server Management

Hi,
i'm working on the rtm version of mssql 2005 and i'm wondering to find that the database list are hard coded into SQL Server Management.
I need to hide databases list for (newbie) users on EM 2000 i can hide this list using this kb http://support.microsoft.com/?id=889696 but on the new SQLSM

The database list is hard coded into this batch query

SELECT

dtb.name AS [Database_Name],

'Server[@.Name=' + quotename(CAST(serverproperty(N'Servername') AS sysname),'''') + ']' + '/Database[@.Name=' + quotename(dtb.name,'''') + ']'

AS [Database_Urn],

case

-- if all these are false then we are in the Normal state

-- except some return NULL if it's AutoClosed

when (DATABASEPROPERTY(dtb.name,'IsInLoad') = 0 and

(DATABASEPROPERTY(dtb.name,'IsInRecovery') = 0 or DATABASEPROPERTY(dtb.name,'IsInRecovery') is null) and

(DATABASEPROPERTY(dtb.name,'IsNotRecovered') = 0 or DATABASEPROPERTY(dtb.name,'IsNotRecovered') is null) and

DATABASEPROPERTY(dtb.name,'IsSuspect') = 0 and

DATABASEPROPERTY(dtb.name,'IsOffline') = 0 and

DATABASEPROPERTY(dtb.name,'IsInStandBy') = 0 and

(DATABASEPROPERTY(dtb.name,'IsShutDown') = 0 or DATABASEPROPERTY(dtb.name,'IsShutDown') is null) and

DATABASEPROPERTY(dtb.name,'IsEmergencyMode') = 0) then 1

else 0

end |

case

when DATABASEPROPERTY(dtb.name,'IsInLoad') = 1 then 2

else 0

end |

case

when DATABASEPROPERTY(dtb.name,'IsInRecovery') = 1 and

DATABASEPROPERTY(dtb.name,'IsNotRecovered') = 1 then 4

else 0

end |

case

when DATABASEPROPERTY(dtb.name,'IsInRecovery') = 1 then 8

else 0

end |

case

when DATABASEPROPERTY(dtb.name,'IsSuspect') = 1 then 16

else 0

end |

case

when DATABASEPROPERTY(dtb.name,'IsOffline') = 1 then 32

else 0

end |

case

when DATABASEPROPERTY(dtb.name,'IsInStandBy') = 1 then 64

else 0

end |

case

when DATABASEPROPERTY(dtb.name,'IsShutDown') = 1 then 128

when DATABASEPROPERTY(dtb.name,'IsShutDown') is null then (512 + 128)

else 0

end |

case

when DATABASEPROPERTY(dtb.name,'IsEmergencyMode') = 1 then 256

else 0

end

AS [Database_Status],

dtb.cmptlevel AS [Database_CompatibilityLevel],

CASE DATABASEPROPERTYEX(dtb.name, 'Recovery') WHEN 'SIMPLE' THEN 3 WHEN 'BULK_LOGGED' THEN 2 ELSE /*FULL*/ 1 END AS [RecoveryModel],

CASE CONVERT(sysname,DATABASEPROPERTYEX(dtb.name, 'UserAccess')) WHEN 'SINGLE_USER' THEN 1 WHEN 'RESTRICTED_USER' THEN 2 ELSE /*MULTI_USER*/

0 END AS [UserAccess],

CAST(DATABASEPROPERTY(dtb.name, 'IsReadOnly') AS bit) AS [ReadOnly],

dtb.name AS [Database_DatabaseName2]

FROM

master.dbo.sysdatabases AS dtb

WHERE

(CAST(case when dtb.name in ('master','model','msdb','tempdb') then 1 else category & 16 end AS bit)=0)

ORDER BY

[Database_Name] ASC

So my question it's possible to have a stored procedure on the next fix of mssql 2005 with a stored procedure on the master database to show the database list, i know that the database are listed on the table master.dbo.sysdatabases but i need to hide database for newbie users.

If your question is related to Management Studio, please post to SQL Server Tools General.

If you don't want a user to be able to see all entries of sys.databases/sysdatabases, then you can just deny VIEW ANY DATABASE permission to them. By default, this permission is assigned to public (for backward compatibility with SQL Server 2000), so every principal has it.

Thanks
Laurentiu|||Hi Laurentiu,
yes the question is related to Management Studio and i'll post on the correct forum.
Thank's|||

Note: with SP2 client, DENY VIEW ANY DATABASE TO <login> results in NO, NONE, NATA databases other than master and tempdb being visible in object explorer. The problem is clearly that SSMS calls master.dbo.databases - if it would just call dbo.databases (using the login's default database) then all the databases the user has access to might be listed. I will check the other forum for help, but MS PM's- if you're listening- this is terribly annoying.

Yes, I have tried adding the logins as users in master, then granting select on the system view- deny view any database permission trumps it. Also, why is there no [GRANT/REVOKE/DENY] VIEW DATABASE::<dbname> syntax?!!!

Other than permissions, and their quirks such as this, SQL Server is a great product.

Database List Hardcoded into SQL Server Management

Hi,
i'm working on the rtm version of mssql 2005 and i'm wondering to find that the database list are hard coded into SQL Server Management.
I need to hide databases list for (newbie) users on EM 2000 i can hide this list using this kb http://support.microsoft.com/?id=889696 but on the new SQLSM

The database list is hard coded into this batch query

SELECT

dtb.name AS [Database_Name],

'Server[@.Name=' + quotename(CAST(serverproperty(N'Servername') AS sysname),'''') + ']' + '/Database[@.Name=' + quotename(dtb.name,'''') + ']'

AS [Database_Urn],

case

-- if all these are false then we are in the Normal state

-- except some return NULL if it's AutoClosed

when (DATABASEPROPERTY(dtb.name,'IsInLoad') = 0 and

(DATABASEPROPERTY(dtb.name,'IsInRecovery') = 0 or DATABASEPROPERTY(dtb.name,'IsInRecovery') is null) and

(DATABASEPROPERTY(dtb.name,'IsNotRecovered') = 0 or DATABASEPROPERTY(dtb.name,'IsNotRecovered') is null) and

DATABASEPROPERTY(dtb.name,'IsSuspect') = 0 and

DATABASEPROPERTY(dtb.name,'IsOffline') = 0 and

DATABASEPROPERTY(dtb.name,'IsInStandBy') = 0 and

(DATABASEPROPERTY(dtb.name,'IsShutDown') = 0 or DATABASEPROPERTY(dtb.name,'IsShutDown') is null) and

DATABASEPROPERTY(dtb.name,'IsEmergencyMode') = 0) then 1

else 0

end |

case

when DATABASEPROPERTY(dtb.name,'IsInLoad') = 1 then 2

else 0

end |

case

when DATABASEPROPERTY(dtb.name,'IsInRecovery') = 1 and

DATABASEPROPERTY(dtb.name,'IsNotRecovered') = 1 then 4

else 0

end |

case

when DATABASEPROPERTY(dtb.name,'IsInRecovery') = 1 then 8

else 0

end |

case

when DATABASEPROPERTY(dtb.name,'IsSuspect') = 1 then 16

else 0

end |

case

when DATABASEPROPERTY(dtb.name,'IsOffline') = 1 then 32

else 0

end |

case

when DATABASEPROPERTY(dtb.name,'IsInStandBy') = 1 then 64

else 0

end |

case

when DATABASEPROPERTY(dtb.name,'IsShutDown') = 1 then 128

when DATABASEPROPERTY(dtb.name,'IsShutDown') is null then (512 + 128)

else 0

end |

case

when DATABASEPROPERTY(dtb.name,'IsEmergencyMode') = 1 then 256

else 0

end

AS [Database_Status],

dtb.cmptlevel AS [Database_CompatibilityLevel],

CASE DATABASEPROPERTYEX(dtb.name, 'Recovery') WHEN 'SIMPLE' THEN 3 WHEN 'BULK_LOGGED' THEN 2 ELSE /*FULL*/ 1 END AS [RecoveryModel],

CASE CONVERT(sysname,DATABASEPROPERTYEX(dtb.name, 'UserAccess')) WHEN 'SINGLE_USER' THEN 1 WHEN 'RESTRICTED_USER' THEN 2 ELSE /*MULTI_USER*/

0 END AS [UserAccess],

CAST(DATABASEPROPERTY(dtb.name, 'IsReadOnly') AS bit) AS [ReadOnly],

dtb.name AS [Database_DatabaseName2]

FROM

master.dbo.sysdatabases AS dtb

WHERE

(CAST(case when dtb.name in ('master','model','msdb','tempdb') then 1 else category & 16 end AS bit)=0)

ORDER BY

[Database_Name] ASC

So my question it's possible to have a stored procedure on the next fix of mssql 2005 with a stored procedure on the master database to show the database list, i know that the database are listed on the table master.dbo.sysdatabases but i need to hide database for newbie users.

If your question is related to Management Studio, please post to SQL Server Tools General.

If you don't want a user to be able to see all entries of sys.databases/sysdatabases, then you can just deny VIEW ANY DATABASE permission to them. By default, this permission is assigned to public (for backward compatibility with SQL Server 2000), so every principal has it.

Thanks
Laurentiu|||Hi Laurentiu,
yes the question is related to Management Studio and i'll post on the correct forum.
Thank's|||

Note: with SP2 client, DENY VIEW ANY DATABASE TO <login> results in NO, NONE, NATA databases other than master and tempdb being visible in object explorer. The problem is clearly that SSMS calls master.dbo.databases - if it would just call dbo.databases (using the login's default database) then all the databases the user has access to might be listed. I will check the other forum for help, but MS PM's- if you're listening- this is terribly annoying.

Yes, I have tried adding the logins as users in master, then granting select on the system view- deny view any database permission trumps it. Also, why is there no [GRANT/REVOKE/DENY] VIEW DATABASE::<dbname> syntax?!!!

Other than permissions, and their quirks such as this, SQL Server is a great product.