You are here: Re: Want to grab a list of available databases on a given server « MsSQL Server « IT news, forums, messages
Re: Want to grab a list of available databases on a given server

Posted by Ross Presser on 06/08/05 16:33

On Tue, 07 Jun 2005 22:18:30 GMT, Joe Cool wrote:

> On Tue, 07 Jun 2005 17:52:02 GMT, "_AnonCoward" <abc@xyz.com> wrote:
>
>>I have MSDE running on my system and I want to get a list of databases
>>for that server programmatically. I'm using vb.net and I want to view,
>>add, delete and modify databases on a server from within a class.
>>
>>
>>I'm aware I can use the "Server Explorer" feature in Visual Studio, but
>>that isn't what I'm looking for. Any references or suggestions on where
>>to start are appreciated.
>
> I have used the Information Schema to do this with:
>
> select catalog_name as name from information_schema.schemata
>
> This worked fine with SQL7, but I have had some problems with it with
> SQL2K. User databases don't show up in the Information Schema until
> they have been accessed.

A alternative that would work with SQL 6.5 and up would be

SELECT name from master.dbo.sysdatabases

Almost certainly *won't* work with any non-MS RDBMS, though.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация