quizwedge
asked on
Export tables with foreign keys
I've got a database with 61 tables that have varying foreign keys. I'm trying to export it from SQL Server 2008 to SQL Server 2005 and keep running into problems because the export isn't smart enough to know what order the tables need to go in to not violate foreign keys. I've been trying to do a couple tables at a time, but don't know enough about things to know what order I should copy the tables in. What's the easiest way to figure out the order?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I saw the suggestion from sjwales and ended up implementing one of EugeneZ's before I saw the post. I think ScottPletcher's solution would work if I gave him the opportunity to update the code, but wanted to close the question since I solved the problem. Thanks for all of the help.
ASKER
The statement terminated. The maximum recursion 100 has been exhausted before statement completion.
I ended up using the suggestions from @sjwales and @EugeneZ
Thanks