public static DbTable GetByName(DbConnector dbConn, string name) { dbConn.SetQueryText(string.Format("{0} where type = 'U' and name = '{1}'", _selectQuery, name)); dbConn.Execute(); if (!dbConn.NextRow()) { return null; } var t = new DbTable(); t.FromDb(dbConn); return t; }
public static DbSchemaChange GetByNo(DbConnector dbConn, uint changeNo) { dbConn.SetQueryText(string.Format("select ChangeID, ChangeNo, ScriptName, DateInstall from A_SCHEMA_CHANGES_LOG where ChangeNo = {0}", changeNo)); dbConn.Execute(); if (!dbConn.NextRow()) { return null; } var sch = new DbSchemaChange(); sch.FromDb(dbConn); return sch; }
public static DbSchemaChange GetLast(DbConnector dbConn) { dbConn.SetQueryText("select ChangeID, ChangeNo, ScriptName, DateInstall from A_SCHEMA_CHANGES_LOG order by ChangeNo desc"); dbConn.Execute(); if (!dbConn.NextRow()) { return null; } var sch = new DbSchemaChange(); sch.FromDb(dbConn); return sch; }
public static List<DbTrigger> GetAll(DbConnector dbConn) { dbConn.SetQueryText(string.Format("{0} where type = N'TR'", _selectQuery)); dbConn.Execute(); List<DbTrigger> trigs = new List<DbTrigger>(); while (dbConn.NextRow()) { var t = new DbTrigger(); t.FromDb(dbConn); trigs.Add(t); } return trigs; }
public static List<DbTable> GetAll(DbConnector dbConn) { dbConn.SetQueryText(string.Format("{0} where type = 'U'", _selectQuery)); dbConn.Execute(); List<DbTable> tables = new List<DbTable>(); while (dbConn.NextRow()) { var t = new DbTable(); t.FromDb(dbConn); tables.Add(t); } return tables; }
public static List<DbFunction> GetAll(DbConnector dbConn) { dbConn.SetQueryText(string.Format("{0} where type in (N'FN', N'IF', N'TF', N'FS', N'FT')", _selectQuery)); dbConn.Execute(); List<DbFunction> functions = new List<DbFunction>(); while (dbConn.NextRow()) { var f = new DbFunction(); f.FromDb(dbConn); functions.Add(f); } return functions; }
public static List<DbView> GetAll(DbConnector dbConn) { dbConn.SetQueryText(string.Format("{0} where type = N'V'", _selectQuery)); dbConn.Execute(); List<DbView> views = new List<DbView>(); while (dbConn.NextRow()) { var v = new DbView(); v.FromDb(dbConn); views.Add(v); } return views; }
public static List<DbProcedure> GetAll(DbConnector dbConn) { dbConn.SetQueryText(string.Format("{0} where type in (N'P', N'PC')", _selectQuery)); dbConn.Execute(); List<DbProcedure> procs = new List<DbProcedure>(); while (dbConn.NextRow()) { var p = new DbProcedure(); p.FromDb(dbConn); procs.Add(p); } return procs; }