Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Initial Catalog

Author  Topic 

tbrothers
Yak Posting Veteran

83 Posts

Posted - 2008-07-30 : 15:23:16
Hi:
On our SQL 2005 Reporting Services server we are using a shared data source. The connection string is Data Source=SQL2K5-PUB;Initial Catalog=ESI.

Exactly what does the term "initial" mean?


Thanks,
Terry

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-07-30 : 15:24:49
It just means what database to use.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

tbrothers
Yak Posting Veteran

83 Posts

Posted - 2008-07-30 : 15:33:35
So if the report needs resources from multiple databases, does it matter which database is specified as "initial"?

Thanks,
Terry
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-07-30 : 15:35:00
Just pick whatever one you use most.

Hopefully you are using stored procedures and can switch databases in there.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

tbrothers
Yak Posting Veteran

83 Posts

Posted - 2008-07-30 : 15:38:29
Yep - Using stored procedures. All SP's and views are in a separate and dedicated SRS database I created for the report writers to use. This way they don't need any special permissions to our accounting (production) databases.

Thanks for the clarification Tara.

Thanks,
Terry
Go to Top of Page

tbrothers
Yak Posting Veteran

83 Posts

Posted - 2008-07-30 : 16:38:28
I think I have it figured out now. If a report uses a SP in database RPT and the initial catalog is RPT then the report does not need to specify FROM RPT..<tablename> as it'll default to the RPT database.

So ... Is there a Best Practice concerning referencing database objects? In other words, are there pros and cons to Always specifying the database (e.g. FROM DBname..TBLname)?

Thanks,
Terry
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-07-30 : 16:41:44
The con is that you can't easily port your database to another instance if you want to use a different database name. So take for example a test environment where you might have a few copies of a production database all on one instance. You can't have duplicate database names, so you've named them prodcopy1, prodcopy2, prodcopy3. In your scenario, you'd have to modify code in order to use these different names. This would be a huge issue in our environment due to the hundreds if not thousands of stored procedures in use.


Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -