I have a SQL Server database which has data for several customers/devices. We are changing the prefix of our website (asp.net) and our application dynamically loads the proper connection string based on the first part of the URL. Is it safe for me to change the name of my database accordingly, or should I simply put a conditional statement in the connection string logic to make the new URL point to the old database? Thanks!
Sql-server – Is it safe to change the name of a database
sql-server-2008
Related Question
- SQL Server Output Issues – Why Am I Missing Some Output?
- Sql-server – Change SQL Server 2008 name
- Sql-server – SQL Server 2008 – Question about index behaviour
- SQL Server – How to Decide on a Replication Strategy
- Preventing Full Backups for Unmodified or Slightly Modified Databases in SQL Server 2008
- SQL Server 2008 – How to Handle Accidental Database Name Change
- SQL Server Upgrade – Fix Timeout Error from 2008R2 to 2014
- Building Relationships with Variable Columns in SQL Server
Best Answer
If you have queries that reference the full database name (which you likely will have if you have cross database queries), they will break. If you have Imports or reports that reference the full database name those will break. If you have linked servers (SQL server), those will break. If you have other applications that hit the same database backend, those will likely break.
If you have none of those situations, you may be OK. However, you will still want to do this only if you have a full test suite to be able to verify that nothing broke. Keeping the database name and changing how the application connects is a far safer choice if you don't have a good test suite.