create 2 databases with same name on the server

  • hi

    i would like to create 2 databases with the same name on the same server but with different ip adresse.in fact, on the same server, each database will have its own ip adress so it can be available on a specific that address for the client connection but the both database must have the same name by the end of the day

  • Not possible. You will need a named instance for each

    Alternatively, you can create one database with each set of tables using a different schema.

  • Is this for experimenting or an actual request?

  • it's a request.but just to make sure that it's still not possible

    thx guys

  • Databases don't have IP addresses. The IP address belongs to the server. Like said before you would need to have named instances running to have the same db name multiple times on the same server. And of course the connection strings would have to reflect the named instance too.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • Sean Lange (2/6/2012)


    Databases don't have IP addresses. The IP address belongs to the server. Like said before you would need to have named instances running to have the same db name multiple times on the same server. And of course the connection strings would have to reflect the named instance too.

    possibly someone is trying to come up with a reporting server or load balancing? or could it be his developer doesn't want to change his connection string, and thinks it's easier to have multiple databases instead.

    dig at the root cause of why they might want what they are requesting...what are they trying to solve?

    kick it back to the developer and ask why he thinks he needs two (presumably duplicate?) databases with the same name.

    ask him what happens if one database is not the same as the other....what are the ramification?

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • the developer does not want to change his connection string or program at every change, that's why he was requested this.if the name of the server changes, he would be obliged to change his program every time the change occurred.that is the main issue.

  • soulesidibe2011 (2/6/2012)


    the developer does not want to change his connection string or program at every change, that's why he was requested this.if the name of the server changes, he would be obliged to change his program every time the change occurred.that is the main issue.

    In that case, keep all data in same database and separate by schemas or by a companyId column.

    Jared
    CE - Microsoft

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply