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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top