Example #1
0
 private static void SetSqlIo(string tableName, XlsIo xlsIo, SqlIo sqlIo)
 {
     SetIdentityInsert(tableName, sqlIo, identityInsert: true);
     xlsIo.XlsSheet.ForEach(xlsRow =>
                            sqlIo.AddSqlStatement(SqlStatement(tableName, xlsIo, xlsRow)));
     SetIdentityInsert(tableName, sqlIo, identityInsert: false);
 }
Example #2
0
 private static void SetIdentityInsert(string tableName, SqlIo sqlIo, bool identityInsert)
 {
     if (Def.ExistsTable(tableName, o => o.Identity))
     {
         sqlIo.SqlContainer.SqlStatementCollection.Add(
             new SqlStatement("set identity_insert [" + tableName + "]" + (identityInsert
             ? " on;"
             : " off;")));
     }
 }