locked
sql server 2008 r2 fix table relationships RRS feed

  • Question

  • I created a windows form program with vs2010 and sql server 2008 r2. Everything works fine with the program and db. The back end was developed by another person, whom it appears to me, didn't know what they were doing.

    Now that I have full control of the back end as well as the front end, I want to make sure I have everything in order.

    There are no table relationships and there are maybe 30 tables.  

    Would it be advisable to fix the db at this point and add all the relationships with this db? Will it really effect anything if I don't?

    I copied the db and added all the relationships on a test db and reconfigured by winform program to reference that db and all seems fine with all the stored procedures and such.  Just not sure if doing so would help in any way.

    I am by no means an sql server pro.

    Tuesday, June 26, 2012 3:12 PM

Answers

  • Again, without details, I can only guess...

    You seem to be describing a group of unrelated tables (no primary key - foreign key relationships at all). Unless all queries are against a single table only, I can't imagine how it would work at all.

    Are there, in fact, logical relationships between the entities represented in the tables (i.e. a Customers table and an Orders table where, logically, a customer places on or more orders and an order would be associated with one customer).

    As you say you've created relationships between tables, the question is: do you plan to improve the app by creating more complex queries that access multiple tables and use the relationships you created? If so, move on to your new database.

    Tuesday, June 26, 2012 8:53 PM

All replies

  • Without details of the original database design and the changes you made, it's no possible to tell you if the changes "would help in any way".

    Were you having issues with the database as originally designed?

    Tuesday, June 26, 2012 5:59 PM
  • The original database design didn't have any table relationships at all.  I am wondering if having these relationships would help in any way.
    Tuesday, June 26, 2012 6:09 PM
  • Again, without details, I can only guess...

    You seem to be describing a group of unrelated tables (no primary key - foreign key relationships at all). Unless all queries are against a single table only, I can't imagine how it would work at all.

    Are there, in fact, logical relationships between the entities represented in the tables (i.e. a Customers table and an Orders table where, logically, a customer places on or more orders and an order would be associated with one customer).

    As you say you've created relationships between tables, the question is: do you plan to improve the app by creating more complex queries that access multiple tables and use the relationships you created? If so, move on to your new database.

    Tuesday, June 26, 2012 8:53 PM