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

  • Thread starter Thread starter Krys
  • Start date Start date
K

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")?
 
The InitialCatalog is the name of the database you want to access in your
SQLServer database, like "Northwind" or "pubs".

Robin S.
 
The InitialCatalog is the name of the database you want to access in your
SQLServer database, like "Northwind" or "pubs".

Robin S.

Try with a query:
SELECT * FROM sys.databases ;)
 
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
 
Back
Top