Tuesday, March 27, 2012

Alias for a database name?

Hi there,
I'm using SQL Server 2000.
I've created a database that has the name "SworderNet.ProductAnalysis."
Various applications connect to this database using this name. Well, it
turns out that certain programs like Excel have a problem accessing SQL
databases that have a "." in the name. The simplest solution is obviously to
just rename the database but it would be a major hassle to try to track down
all of the various clients that use this database and change the
appropriate config files to reflect the new name. Is there a way to create
an "alias" name for this database (similar to a CNAME record in dns)? For
example, I'd like to create an alias called "ProductAnalysis"... The
original name would still work, but clients that have problems with "."
embedded in the database name can just use the alias name instead.
Is it possible?
Sincerely,
David SworderI'm afraid not. The closest would be to create a new database and for each
table create a view inside that database. Not a nice solution...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"David Sworder" <GilGrissom@.CSILasVegas.com> wrote in message
news:unJfw9IDEHA.1600@.tk2msftngp13.phx.gbl...
> Hi there,
> I'm using SQL Server 2000.
> I've created a database that has the name
"SworderNet.ProductAnalysis."
> Various applications connect to this database using this name. Well, it
> turns out that certain programs like Excel have a problem accessing SQL
> databases that have a "." in the name. The simplest solution is obviously
to
> just rename the database but it would be a major hassle to try to track
down
> all of the various clients that use this database and change the
> appropriate config files to reflect the new name. Is there a way to create
> an "alias" name for this database (similar to a CNAME record in dns)? For
> example, I'd like to create an alias called "ProductAnalysis"... The
> original name would still work, but clients that have problems with "."
> embedded in the database name can just use the alias name instead.
> Is it possible?
> --
> Sincerely,
> David Sworder
>|||Hi,
I have a workaround.
The overhead of this workaround might be large depending upon the database
size and the number of users accessing it.
I tried to replicate the database to the same server with a different name.
If the application, that is facing problem, accessing the database with "."
in its name, does not update the data, then the replication can be
transactional and a frequency can be set for updating the new database.
But again as I said, the overhead may be big. But this workaround would
eliminate the requirement of renaming the database and changing it in the
various clients.
Ashish
This posting is provided "AS IS" with no warranties, and confers no rights.

No comments:

Post a Comment