示例#1
0
 public ReadLinkOra05(string name, int iterationCount, int rowCount, string connString)
     : base(name, iterationCount, rowCount, connString)
 {
     this._cmd   = new SqlCommand("SELECT DISTINCT e.UserCode, e.ObjectId FROM E11696 e INNER JOIN @t1 t ON t.UserCode = e.UserCode WHERE e.State = 0", this._conn);
     this._codes = new StructuredParamValue(new[] { new SqlMetaData("UserCode", SqlDbType.NVarChar, 10) }, rowCount);
     this._cmd.AddStructuredParam("@t1", "dbo.E11696_ImportType", this._codes);
 }
示例#2
0
        public Save3(string name, int iterationCount, int rowCount, string connString) : base(name, iterationCount, connString)
        {
            this._rowCount = rowCount;

            this._positions = new StructuredParamValue(
                new[]
            {
                new SqlMetaData("Directive", SqlDbType.Int),
                new SqlMetaData("GUID", SqlDbType.UniqueIdentifier),
                new SqlMetaData("ObjectID", SqlDbType.UniqueIdentifier),
                new SqlMetaData("PatchID", SqlDbType.Int),
                new SqlMetaData("UserCode", SqlDbType.NVarChar, 10),
                new SqlMetaData("DocumentBeginDate", SqlDbType.DateTime),
                new SqlMetaData("DocumentEndDate", SqlDbType.DateTime),
                new SqlMetaData("ActualBeginDate", SqlDbType.DateTime),
                new SqlMetaData("ActualEndDate", SqlDbType.DateTime),
                new SqlMetaData("State", SqlDbType.Int),
                new SqlMetaData("RemoveLeft", SqlDbType.Bit),
                new SqlMetaData("RemoveRight", SqlDbType.Bit),
                new SqlMetaData("ObjectDel", SqlDbType.Int),
                new SqlMetaData("RecordType", SqlDbType.Int),
                new SqlMetaData("C1783376938461729511", SqlDbType.NVarChar, 10),
                new SqlMetaData("C8592504141572910447", SqlDbType.NVarChar, 50)
            }, rowCount);

            this._dedup = new StructuredParamValue(
                new[]
            {
                new SqlMetaData("ID", SqlDbType.UniqueIdentifier),
                new SqlMetaData("DEDUP_STR_1", SqlDbType.NVarChar, -1),
                new SqlMetaData("DEDUP_STR_2", SqlDbType.NVarChar, -1),
                new SqlMetaData("DEDUP_STR_3", SqlDbType.NVarChar, -1)
            }, rowCount);

            this._beginTran  = SqlServer.GetCommand("BEGIN TRANSACTION", this._conn);
            this._commitTran = SqlServer.GetCommand("COMMIT TRANSACTION WITH (DELAYED_DURABILITY = ON)", this._conn);

            StringBuilder sql1 = new StringBuilder();

            sql1.AppendLine("INSERT INTO IT_6819804243173122816(Directive, GUID, ObjectID, PatchID, UserCode, DocumentBeginDate, DocumentEndDate, ActualBeginDate, ActualEndDate, State, RemoveLeft, RemoveRight, ObjectDel, RecordType, C1783376938461729511, C8592504141572910447)");
            sql1.Append("SELECT Directive, GUID, ObjectID, PatchID, UserCode, DocumentBeginDate, DocumentEndDate, ActualBeginDate, ActualEndDate, State, RemoveLeft, RemoveRight, ObjectDel, RecordType, C1783376938461729511, C8592504141572910447 FROM @t1");

            this._savePosition = SqlServer.GetCommand(sql1.ToString(), this._conn);
            this._savePosition.AddStructuredParam("@t1", "dbo.IT_6819804243173122816_Positions", this._positions);

            StringBuilder sql2 = new StringBuilder();

            sql2.AppendLine("INSERT INTO IT_5278945729007601847(ID, DEDUP_STR_1, DEDUP_STR_2, DEDUP_STR_3)");
            sql2.Append("SELECT ID, DEDUP_STR_1, DEDUP_STR_2, DEDUP_STR_3 FROM @t1");

            this._saveDedup = SqlServer.GetCommand(sql2.ToString(), this._conn);
            this._saveDedup.AddStructuredParam("@t1", "dbo.IT_5278945729007601847_Dedup", this._dedup);
        }
示例#3
0
 public ReadLinkOra051(string name, int iterationCount, int rowCount, string connString)
     : base(name, iterationCount, rowCount, connString)
 {
     this._cmd   = new SqlCommand("SELECT e.UserCode, e.ObjectId, t.RowIndex FROM E11696 e INNER JOIN @t1 t ON t.UserCode = e.UserCode AND t.DocumentBeginDate BETWEEN e.DocumentBeginDate AND e.DocumentEndDate WHERE e.State = 0", this._conn);
     this._codes = new StructuredParamValue(
         new[]
     {
         new SqlMetaData("UserCode", SqlDbType.NVarChar, 10),
         new SqlMetaData("DocumentBeginDate", SqlDbType.DateTime),
         new SqlMetaData("RowIndex", SqlDbType.Int)
     }, rowCount);
     this._cmd.AddStructuredParam("@t1", "dbo.E11696_ImportType1", this._codes);
 }
示例#4
0
 public static SqlParameter AddStructuredParam(this SqlCommand command, string paramName, string typeName, StructuredParamValue value)
 {
     return(command.Parameters.Add(new SqlParameter {
         ParameterName = paramName, SqlDbType = SqlDbType.Structured, TypeName = typeName, Value = value
     }));
 }