Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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!

share|improve this question
1  
Hard to answer without more detail. Why wouldn't it be safe? –  theglauber Feb 28 '12 at 20:30
    
voted to close - too localized...you say you have a system to map the url to the connection string...so why would you want to go around that system? –  dotjoe Feb 28 '12 at 20:31
    
As long as your connection strings and any data that relies on knowing the database name are changed, then this should be safe. –  Justin Pihony Feb 28 '12 at 20:31
    
That's the point - I don't want to circumvent the logic there. Just wondering if it's a bad practice to change the database name or if there are other ramifications I' –  Joshua Smith Feb 28 '12 at 20:54
    
Which DBMS are you using? "SQL database" does not describe a specific product. –  a_horse_with_no_name Feb 28 '12 at 23:00
show 1 more comment

migrated from stackoverflow.com Feb 28 '12 at 22:24

This question came from our site for professional and enthusiast programmers.

1 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 datbase backend, those will likely break.

If you have none of those situations, you may be ok, but 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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.