Using "Create Table" for an SQL Server 2008 R2 database -
If I'm going to write a whole SQL script to create a database with tables (foreign key) I should write Dependent tables first?
You have a few options:
- You can create, and then use the
optional table to add the foreign key.
- As you build tables, you can make one of the many relationships. In that case, the table will be the order of creation.
When you make such a DB (not many times), give the seeds to the tables along with the data
How much data do you enter, before or after INSERT data Decision to implement RI. If you have small tables, then RI check does not consume lots of resources. If you have a large table, then you can insert the data first and then apply RI - such a check was not made in one line at a time. But at one time for all the rows Since you are sewing tables, you know your data - you will probably clean up the insertion so that the downstream ry does not fail to check.
- As you build tables, you can make one of the many relationships. In that case, the table will be the order of creation.
Comments
Post a Comment