Table relationship

  • Hi all,

    I have been trying to modify a table in a newly migrated database. I checked all database level security. As an sa, I understand that I have full control on the database as well as it's tables and hence I have the right to modify. I assume that the table I have been trying to modify is in relationship with one more other tables in the database.

    Is there a T-SQL stored procedure or any other command that helps to find the tables with which the table I am trying to modify is related?

    Thanks indeed

    Niyala

  • do you mean... referential integrity?

    Look for FKs, the easiest way for you is to ask SQL Server to draw a chart based on your offending table.

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
  • Another way is to:

    In management Studio...Right Click on the tablename...go to ViewDependencies.

    That should give you objects dependant on that table, and object that table depends on.

    K

  • Thanks a lot. I'll give it a try.

    Regards

    Niyala

  • Thanks a lot. This was a very good hint. I noticed that I have at least 50 objects (stored procedures and views) that are dependent on the table I have been trying to modify.

    It would be great if you could give me suggestions on how to migrate the original data so that modification is not needed.

    The issue is as follows:

    A colleague migrated the original data to a new server. However, he wants to keep working on the original data and make changes to the new data whenever there is a change made in the original data. Nonetheless, we are facing the problem of modification in the new data due to dependencies.

    In these situation, what would be better? What would be a smooth migration strategy?

    Thanks for your advice

    Niyala

  • Something doesn't makes sense to me, having storedprocs and views referencing your offending table should not prevent you from making changes to that table.

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
  • Thanks for your information, I could sort out the problem of modifying the table in question. However, I am still trying to solve the following issue:

    A colleague migrated the original data (D1) on the old sever to a new server. However, he wants to keep working on the original data (D1) on the old sever and make changes to the new data (D2) on the new server whenever there is a change made in the original data (D1).

    In these situation, what would be better? What would be a smooth migration strategy so that changes made in D1 take effect in D2? Is there a means of linking D1 and D2 so that changes made in D1 take effect in (D2)?

    Regards

    Niyala

  • Thanks for your information, I could sort out the problem of modifying the table in question. However, I am still trying to solve the following issue:

    A colleague migrated the original data (D1) on the old sever to a new server. However, he wants to keep working on the original data (D1) on the old sever and make changes to the new data (D2) on the new server whenever there is a change made in the original data (D1).

    In these situation, what would be better? What would be a smooth migration strategy so that changes made in D1 take effect in D2? Is there a means of linking D1 and D2 so that changes made in D1 take effect in (D2)?

    Regards

    Niyala

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

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