title: C# SMO not scripting constraints
body: <p>I'm using SMO in C# for generate the script of the whole schema from a database.</p>
  
  <p>Here is the code i'm using:</p>
  
  <pre><code>  // Instanciando
    Server srv = new Server(con);
  
    // Reference the database.  
    Database db = srv.Databases[ConfigurationManager.AppSettings["DB"].ToString()];
  
    // Instanciando el scripteador
    Scripter scrp = new Scripter(srv);
    var urns = new List&lt;Urn&gt;();
  
    // Propiedades del script
    scrp.Options.IncludeHeaders = true;
    scrp.Options.SchemaQualify = true;
    scrp.Options.SchemaQualifyForeignKeysReferences = true;
    scrp.Options.NoCollation = true;
    scrp.Options.DriAllConstraints = true;
    scrp.Options.DriAll = true;
    scrp.Options.DriAllKeys = true;
    scrp.Options.DriIndexes = true;
    scrp.Options.ClusteredIndexes = true;
    scrp.Options.NonClusteredIndexes = true;
    scrp.Options.ToFileOnly = true;
  
    // Obteniendo las tablas de la BD   
    foreach (Table tb in db.Tables)
    {
      // check if the table is not a system table
      if(!tb.IsSystemObject)
      {
        urns.Add(tb.Urn);
      }
    }
  
    // Instanciando un string builder para construir el script
    StringBuilder builder = new StringBuilder();
    System.Collections.Specialized.StringCollection sc = scrp.Script(urns.ToArray());
    foreach (string st in sc)
    {
      // Agregando los comandos al string builder
      builder.AppendLine(st);
      builder.AppendLine("GO"); // Se coloca GO al final de cada statement
    }
  
    // Escribiendo el archivo
    File.WriteAllText(path, builder.ToString());
  </code></pre>
  
  <p>The problem is that the script is being generated without any constraint. (FK, PK, UQ, CK).</p>
  
  <p>What am i doing wrong?</p>