|
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]
|