internal void CreateFirebirdIdTable(string tableName, string columnName, DatabaseAgent agent) { string IdTableName = string.Format("{0}NID", tableName); // create a table to hold the next id for the specified table /* * This is specifically for Firebird since it doesn't have a way to * easily create an autoincrementing id field. The closest thing they * have is "Generators" used in "before insert" triggers. Attempts * to go in that direction is proving time consuming. So, I'm * implementing my own ID Generator to be used internally to this component. */ try { agent.ExecuteSqlFormat(DatabaseAgent.CREATETABLEFORMAT, IdTableName, string.Format("{0} BIGINT", columnName)); agent.ExecuteSqlFormat(DatabaseAgent.INSERTFORMAT, IdTableName, columnName, "0"); } catch (Exception ex) { CreateTableResult result = CatchException(ex, IdTableName); if (result != CreateTableResult.Success && result != CreateTableResult.AlreadyExists) { throw ex; } } }