Home All Groups Group Topic Archive Search About

Available "Initial Catalog" in given Data Source (sql)

Author
18 Feb 2007 10:38 PM
Krys
In SQL connection string i have to provide Initial Catalog and Data 
Source. How can i read available initial catalogues when i know only the 
given Data Source (for example "(local)\SQLEXPRESS")?

Author
19 Feb 2007 4:06 AM
RobinS
The InitialCatalog is the name of the database you want to access in your
SQLServer database, like "Northwind" or "pubs".

Robin S.
--------------------------------------------------
Show quote
"Krys" <i*@is.fake> wrote in message news:op.tnyuicq0kno4s0@krys...
> In SQL connection string i have to provide Initial Catalog and Data
> Source. How can i read available initial catalogues when i know only the
> given Data Source (for example "(local)\SQLEXPRESS")?
Author
19 Feb 2007 9:37 AM
oscar.acostamontesde@googlemail.com
On Feb 19, 5:06 am, "RobinS" <Rob...@NoSpam.yah.none> wrote:
> The InitialCatalog is the name of the database you want to access in your
> SQLServer database, like "Northwind" or "pubs".
>
> Robin S.
> --------------------------------------------------
>
> "Krys" <i***@is.fake> wrote in messagenews:op.tnyuicq0kno4s0@krys...
> > In SQL connection string i have to provide Initial Catalog and Data
> > Source. How can i read available initial catalogues when i know only the
> > given Data Source (for example "(local)\SQLEXPRESS")?

Try with a query:
SELECT * FROM sys.databases ;)
Author
19 Feb 2007 3:46 PM
RobinS
<oscar.acostamonte***@googlemail.com> wrote in message
Show quote
news:1171877855.020794.147210@v45g2000cwv.googlegroups.com...
> On Feb 19, 5:06 am, "RobinS" <Rob...@NoSpam.yah.none> wrote:
>> The InitialCatalog is the name of the database you want to access in
>> your
>> SQLServer database, like "Northwind" or "pubs".
>>
>> Robin S.
>> --------------------------------------------------
>>
>> "Krys" <i***@is.fake> wrote in messagenews:op.tnyuicq0kno4s0@krys...
>> > In SQL connection string i have to provide Initial Catalog and Data
>> > Source. How can i read available initial catalogues when i know only
>> > the
>> > given Data Source (for example "(local)\SQLEXPRESS")?
>
> Try with a query:
> SELECT * FROM sys.databases ;)
>
What if you leave out the InitialCatalog phrase in the connection string?

Have you checked out http://www.connectionstrings.com to see if there's any
info that will help you there?

Robin S.
Author
26 Feb 2007 6:28 PM
Rad [Visual C# MVP]
On Sun, 18 Feb 2007 23:38:26 +0100, Krys wrote:

> In SQL connection string i have to provide Initial Catalog and Data 
> Source. How can i read available initial catalogues when i know only the 
> given Data Source (for example "(local)\SQLEXPRESS")?

If i'm not wrong if you don't specify an initial calalog SQL server will
connect to the default database of the user specified in the connection
string

AddThis Social Bookmark Button