Posts Tagged Filename

Corrigenda, Errata for the “Parallel Load CSV Using SqlBulkCopy”.


Introduction

This post is a “patch up” for the post I made yesterday. The “Parallel Load CSV Data Using SqlBulkCopy” blog posts has one omission.  I have forgotten to post one of the source files. The missing file was the SqlLoadResults class. This file is included below.

SqlLoadResults.cs:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ParallelLoader
{
    /// <summary>
    /// Internal class, could be public of you wanted to pass the results out further
    /// </summary>
    internal class SqlLoadResults
    {
        #region FileName being loaded
        private string _fileName;
        public string FileName
        {
            get { return _fileName; }
            set { _fileName = value; }
        }
        #endregion
        #region Start Time
        private DateTime _startTime;
        public DateTime StartTime
        {
            get { return _startTime; }
            set { _startTime = value; }
        }
        #endregion
        #region End Time
        private DateTime _endTime;

        public DateTime EndTime
        {
            get { return _endTime; }
            set { _endTime = value; }
        }
        #endregion
        #region Rows Loaded
        private long _rowsLoaded;
        public long RowsLoaded
        {
            get { return _rowsLoaded; }
            set { _rowsLoaded = value; }
        }
        #endregion
        #region Rows Skipped
        private long _rowsSkipped;
        public long RowsSkipped
        {
            get { return _rowsSkipped; }
            set { _rowsSkipped = value; }
        }
        #endregion
        #region Elapsed time
        private long _elapsed;
        public long Elapsed
        {
            get { return _elapsed; }
            set { _elapsed = value; }
        }
        #endregion
        #region Rows Returned
        private long _rowsReturned;
        public long RowsReturned
        {
            get { return _rowsReturned; }
            set { _rowsReturned = value; }
        }
        #endregion
        /// <summary>
        /// Constructor for the class
        /// </summary>
        /// <param name="fileName">File which was loaded</param>
        /// <param name="start">Date Time the load started</param>
        /// <param name="end">Data Time the load ended
        /// rowsLoaded">Count of the rows loaded
        /// rowsSkipped">Count of rows skipped</param>
        /// <param name="elapsed">Clock ticks for the duration
        /// rowsReturned">Rows returned from the Data Reader</param>
        public SqlLoadResults(
            string fileName, DateTime start, DateTime end,
            long rowsLoaded, long rowsSkipped, long elapsed,
            long rowsReturned)
        {
            this._fileName = fileName;
            this._startTime = start;
            this._endTime = end;
            this._rowsLoaded = rowsLoaded;
            this._rowsSkipped = rowsSkipped;
            this._elapsed = elapsed;
            this._rowsReturned = rowsLoaded;
        }
    }
}
Advertisements

, , , , , , , ,

3 Comments

%d bloggers like this: