title: Using Smo in C# - skip constraint generating instructions at the beginning
body: <p>I have to create a full copy of a remote db. I have only one useful and easy way to do it: by generating scripts. I am aware about other ways (create backup, for instance) but I can't use them for some reason.</p>
  
  <p>Since one table might be depend on another (has a foreign key, etc...) and because of this it's pretty difficult to figure out the valid order of creating tables, I decide to generate these "dependable" script instructions at the very end. </p>
  
  <p>Well, I know how to generate that "dependable" script instructions within (close to) table creation. But what should I do to skip them first only to generate them at the end?</p>
  
  <p>For instance:</p>
  
  <pre><code>--How I do NOT want
  --.........................
  CREATE TABLE Table1(....)
  ALTER TABLE Table1 ADD CONSTRAINT ...
  
  CREATE TABLE Table2(....)
  ALTER TABLE Table2 ADD CONSTRAINT ...
  
  
  
  --How I would like
  --.........................
  CREATE TABLE Table1(....)
  CREATE TABLE Table2(....)
  --.........................
  CREATE TABLE TableN(....)
  --.........................
  --the end of a script
  ALTER TABLE Table1 ADD CONSTRAINT .....
  </code></pre>