none
Bulk Copy from CSV to SQL Server Table RRS feed

  • Question

  • I'm trying to bulk insert data from a CSV file into a SQL Server Table.  This is what I have now.

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.IO;
    using System.Data.SqlClient;
    using System.Data.OleDb;
    using System.Configuration;

    namespace WindowsFormsApplication1
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }

            private void button1_Click(object sender, EventArgs e)
            {
                //  Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\txtFilesFolder\;Extended Properties = "text;HDR=Yes;FMT=Delimited";
                //const string CSV_CONNECTIONSTRING = "Server=EXCEL-PC\\EXCELDEVELOPER;Database=AdventureWorksLT2012;Trusted_Connection=True;";
                const string CSV_CONNECTIONSTRING = Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\txtFilesFolder\;Extended Properties = "text;HDR=Yes;FMT=Delimited";
                string CSVpath = "C:\\Users\\Ryan\\Documents\\Visual Studio 2010\\Projects\\WindowsFormsApplication1\\WindowsFormsApplication1\\bin\\"; // CSV file Path
                var AllFiles = new DirectoryInfo(CSVpath).GetFiles("*.CSV");
                string File_Name = string.Empty;

                for (int i = 0; i < AllFiles.Length; i++)
                {
                    try
                    {
                        File_Name = AllFiles[i].Name;
                        DataTable dt = new DataTable();
                        using (OleDbConnection con = new OleDbConnection(string.Format(CSV_CONNECTIONSTRING, CSVpath)))
                        {
                            using (OleDbDataAdapter da = new OleDbDataAdapter("select * from [" + "Sheet1" + "]", con))
                            {
                                da.Fill(dt);
                            }
                        }

                        using (SqlBulkCopy bulkCopy = new SqlBulkCopy(CSV_CONNECTIONSTRING))
                        {
                            bulkCopy.ColumnMappings.Add(0, "Group");
                            bulkCopy.ColumnMappings.Add(1, "ID");
                            bulkCopy.ColumnMappings.Add(2, "Name");
                            bulkCopy.ColumnMappings.Add(3, "Address");
                            bulkCopy.ColumnMappings.Add(4, "Country");
                            bulkCopy.DestinationTableName = "AllEmployees";
                            bulkCopy.BatchSize = dt.Rows.Count;
                            bulkCopy.WriteToServer(dt);
                            bulkCopy.Close();
                        }

                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message, "Error Message");
                    }

                }
            }

        }

    }

    I know the problem is with this line of code:

    const string CSV_CONNECTIONSTRING = Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\txtFilesFolder\;Extended Properties = "text;HDR=Yes;FMT=Delimited";

    This is based on an example that I found online.  Clearly, the CSV is the source and the ConnectionString points to the DB, but in the example I found online, and in other similar examples, it seems like the ConnectionString points to the CSV, which doesn't make ANY sense at all.

    What am I doing wrong here?

    Thanks everyone!


    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

    Sunday, August 11, 2013 9:01 PM

Answers

  • For connection string see the webpage www.connectionstrings.com" (see text files). Your connection string is not correct because of the double quotes.  I looks like you used a similar connection string as shown on the webpage above.

    Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\txtFilesFolder\;
    Extended Properties
    ="text;HDR=Yes;FMT=Fixed";

    In C# use this

    string connstr =

    "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\txtFilesFolder\\;
    Extended Properties
    =\"text;HDR=Yes;FMT=Fixed\";"

    I replace a single backslash with two backslashes and I put a backslash infront of the two double quotes.


    jdweng

    • Marked as answer by ryguy72 Wednesday, August 14, 2013 2:41 AM
    Sunday, August 11, 2013 9:26 PM
  • There are two _different_ connection strings required for this.  A SQL Server connection string and a CSV file connection string.

    The SQL Server connection string should look like

    Data Source=MyServer;Initial Catalog=SomeDatabase;Integrated Security=SSPI

    or

    Data Source=MyServer\SomeInstance;Initial Catalog=SomeDatabase;Integrated Security=SSPI

    the CSV connection string should look like

    Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\folder\folder\;Extended Properties="text;HDR=Yes;FMT=Delimited";

    EG:

    using System;
    using System.Data;
    using System.Data.OleDb;
    using System.Data.SqlClient;
    using System.IO;
    
    namespace ConsoleApplication5
    {
      class Program
      {
        static void Main(string[] args)
        {
    
          string server = "localhost";
          string database = "tempdb";
          string SQLServerConnectionString = String.Format("Data Source={0};Initial Catalog={1};Integrated Security=SSPI", server, database);
         
    
          string CSVpath = @"C:\temp\"; // CSV file Path
          string CSVFileConnectionString = String.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};;Extended Properties=\"text;HDR=Yes;FMT=Delimited\";", CSVpath);
    
          var AllFiles = new DirectoryInfo(CSVpath).GetFiles("*.CSV");
          string File_Name = string.Empty;
    
          foreach (var file in AllFiles)
          {
            try
            {
              DataTable dt = new DataTable();
              using (OleDbConnection con = new OleDbConnection(CSVFileConnectionString))
              {
                con.Open();
                var csvQuery = string.Format("select * from [{0}]", file.Name);
                using (OleDbDataAdapter da = new OleDbDataAdapter(csvQuery, con))
                {
                  da.Fill(dt);
                }
              }
    
              using (SqlBulkCopy bulkCopy = new SqlBulkCopy(SQLServerConnectionString))
              {
                bulkCopy.ColumnMappings.Add(0, "Group");
                bulkCopy.ColumnMappings.Add(1, "ID");
                bulkCopy.ColumnMappings.Add(2, "Name");
                bulkCopy.ColumnMappings.Add(3, "Address");
                bulkCopy.ColumnMappings.Add(4, "Country");
                bulkCopy.DestinationTableName = "AllEmployees";
                bulkCopy.BatchSize = 0;
                bulkCopy.WriteToServer(dt);
                bulkCopy.Close();
              }
    
            }
            catch (Exception ex)
            {
             Console.WriteLine(ex.ToString());
            }
    
          }
        
    
        }
      }
    }


    David


    David http://blogs.msdn.com/b/dbrowne/


    Monday, August 12, 2013 2:56 PM
  • The error message says that you need to set the DestinationTableName parameter. You have commented out the line which sets DestinationTableName.

    Could these be related?


    Paul Linton

    • Marked as answer by ryguy72 Wednesday, August 14, 2013 2:41 AM
    Tuesday, August 13, 2013 3:24 AM
  • You have 5 column mappings, at least one of them is wrong.  I can't think of anything else that the error message could mean.

    Paul Linton

    • Marked as answer by ryguy72 Wednesday, August 14, 2013 2:40 AM
    Tuesday, August 13, 2013 3:36 AM
  • If you are copying to SQL Server then the DestinationTableName will be a table in the database you are copying to.  Can you show that table definition?  In the column mappings, the second parameter is the name of the field in the destination but you seem to have shown columns from Excel which would be the source.

    Paul Linton

    • Marked as answer by ryguy72 Wednesday, August 14, 2013 2:40 AM
    Tuesday, August 13, 2013 3:55 AM
  • Ryan : Instead of putting the source data into a datatable open the source connection (CSV file) and use method shown on webpage below

    http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopy.aspx


    jdweng

    • Marked as answer by ryguy72 Wednesday, August 14, 2013 2:40 AM
    Tuesday, August 13, 2013 12:28 PM
  • In the database you have 'Addres' with only one 's', your code has 'Address'.

    'Group' is not a good name for a column in SQL because 'Group' is a reserved word.  Notice how SSWS displays the name as '[Group]'.  It may cause you difficulties.


    Paul Linton

    • Marked as answer by ryguy72 Wednesday, August 14, 2013 2:40 AM
    Tuesday, August 13, 2013 12:52 PM

All replies

  • For connection string see the webpage www.connectionstrings.com" (see text files). Your connection string is not correct because of the double quotes.  I looks like you used a similar connection string as shown on the webpage above.

    Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\txtFilesFolder\;
    Extended Properties
    ="text;HDR=Yes;FMT=Fixed";

    In C# use this

    string connstr =

    "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\txtFilesFolder\\;
    Extended Properties
    =\"text;HDR=Yes;FMT=Fixed\";"

    I replace a single backslash with two backslashes and I put a backslash infront of the two double quotes.


    jdweng

    • Marked as answer by ryguy72 Wednesday, August 14, 2013 2:41 AM
    Sunday, August 11, 2013 9:26 PM
  • Hey Joel, it's Ryan!

    I have SQL Server Developer Edition; the name of the server is 'EXCEL-PC\EXCELDEVELOPER'.

    I used an extra slash:

    const string CSV_CONNECTIONSTRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=EXCEL-PC\\EXCELDEVELOPER;Extended Properties=\"text;HDR=Yes;FMT=Delimited\\;";

    I have to point to the SQL Server path, right.  How do I do that?  The name of the server doesn't seem to do it.


    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

    Sunday, August 11, 2013 9:41 PM
  • The CSV connection string has nothing to do with SQL Server.  The "Data Source" in that connection string is a file or folder path accessable from where the code is running.

    David


    David http://blogs.msdn.com/b/dbrowne/

    Sunday, August 11, 2013 10:27 PM
  • Ryan : I told you at are last meeting that I was getting pretty good with SQL Server.  If you are transfering CSV data to a SQL Server you need two connections.  One to the CSV file and the other to the SQL Server.

    Refer to the website www.connectionstrings.com for the answer.

    Usually for SQLExpress I've been using the following

    string server = "ServerName";
    string database = "mydatabase";
    string strCon = String.Format("Data Source={0}\\SQLEXPRESS;" +
       "Initial Catalog={1};Integrated Security=SSPI", +
       server, database);

    I've never used the full version of SQL but have seen the following :

    string strCon = String.Format("Data Source={0};" +
       "Initial Catalog={1};Integrated Security=SSPI", +
       server, database); 

    There are two ways of connecting to a SQL database

       1) Connect to the mdf file using a path

       2) Connect to the SQL manager through a URL.  I use the URL method.  The URL method is better when you have a multi-user database.  the URL manager will resolve conflicts when two or more users are simultaneously using the database.  The URL method is really using HTTP connection using either port 80 or port 8080.

    The path (URL) depends on how you have the database installed.  The security method also depends on your  installation.  At work we have our PC using the same Group Policy so we can remotely connect to any SQL Manager without passwords (Integrated Security=SSPI).  In the SQL manager we have One User Account, and on the same PC we have the same windows user account set up with a group policy that allows everybody on the project access to the database.


    jdweng

    Sunday, August 11, 2013 11:51 PM
  • The original post doesn't actually mention a problem, that I can see.

    Do you get a compilation error?  Do you get a runtime exception?  Does the code run but not give the results you expect?  Some statement about what the problem is would help when trying to fix it.

    The text you have posted would not compile, is that your problem?


    Paul Linton

    Monday, August 12, 2013 12:32 AM
  • Joes-

    I love that example; very easy to setup and maintain.  Now I'm getting this error:

    Here's all of my code:

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.IO;
    using System.Data.SqlClient;
    using System.Data.OleDb;
    using System.Configuration;

    namespace WindowsFormsApplication1
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }

            private void button1_Click(object sender, EventArgs e)
            {

                string server = "EXCEL-PC\\EXCELDEVELOPER";
                string database = "AdventureWorksLT2012";
                string CSV_CONNECTIONSTRING = String.Format("Data Source={0};" + "Initial Catalog={1};Integrated Security=SSPI", server, database);  
                
                string CSVpath = "C:\\Users\\Ryan\\Documents\\Visual Studio 2010\\Projects\\Bulk Copy from CSV to SQL Server Table\\WindowsFormsApplication1\\bin\\"; // CSV file Path
                var AllFiles = new DirectoryInfo(CSVpath).GetFiles("*.CSV");
                string File_Name = string.Empty;

                for (int i = 0; i < AllFiles.Length; i++)
                {
                    try
                    {
                        File_Name = AllFiles[i].Name;
                        DataTable dt = new DataTable();
                        using (OleDbConnection con = new OleDbConnection(string.Format(CSV_CONNECTIONSTRING, CSVpath)))
                        {
                            using (OleDbDataAdapter da = new OleDbDataAdapter("select * from [" + "Sheet1" + "]", con))
                            {
                                da.Fill(dt);
                            }
                        }

                        using (SqlBulkCopy bulkCopy = new SqlBulkCopy(CSV_CONNECTIONSTRING))
                        {
                            bulkCopy.ColumnMappings.Add(0, "Group");
                            bulkCopy.ColumnMappings.Add(1, "ID");
                            bulkCopy.ColumnMappings.Add(2, "Name");
                            bulkCopy.ColumnMappings.Add(3, "Address");
                            bulkCopy.ColumnMappings.Add(4, "Country");
                            bulkCopy.DestinationTableName = "AllEmployees";
                            bulkCopy.BatchSize = dt.Rows.Count;
                            bulkCopy.WriteToServer(dt);
                            bulkCopy.Close();
                        }

                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message, "Error Message");
                    }

                }
            }

        }

    }

    The error occurs on this line:

    using (OleDbConnection con = new OleDbConnection(string.Format(CSV_CONNECTIONSTRING, CSVpath)))

    I think the ConnectionString is correct and I think the CSV path is correct (I'm pretty certain about both).  Maybe I just need to add another 'using' statement, or something like that.  I get no compile errors; just that 1 runtime error.


    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.


    • Edited by ryguy72 Monday, August 12, 2013 1:23 AM
    Monday, August 12, 2013 1:19 AM
  • Put a breakpoint on the line which gives the error.  Inspect the value of CSV_CONNECTIONSTRING.  Notice that it does not have {0} in it, that means that CSVPath is not going to appear in the string which is constructed. 

    I think the connection string is not correct and that the CSV path may be correct but it is not being added to the connection string.

    Try writing a literal connection string that works (that is, hardcode everything - just a simple string, no Format, no concatenation).  Once you have a connection string that works you can then take the next step of constructing it dynamically.


    Paul Linton

    Monday, August 12, 2013 1:54 AM
  • You are getting an error message that says it can't find a provider.  The provider portion of a connection string is usually the driver like the microsoft jet.  When connecting using a URL you don't use the provider, the provider is the SQL application on the server (the data source).

    First check on the SQL server that the services are running.  You may want to manually open the SQL Serveric Manager and see if you can perform a SQL using the Manager.  Opening the service manager may manually start the services.  Then go back and retry your VS application.  If you still get the same failure then the path could be wrong or the Service Manager isn't configured properly (possibly a credential issue).  Is the SQL Database local on your PC or is it remote?  Usually it is best to start debugging these type problems running yoiur VS application on the same PC as the SQL Server which will eliminate some of the connection issues.  Also try to ping the SERVER in cmd.exe window to make sure a route exists.  Another useful tool is "netstat -a" from cmd.exe.  This will show on the SQL Server if a listen port is open for 80 or 8080 indicating the services are running.

    I will do some investigation at work this morning and ask our SQL config specialist some questions


    jdweng

    Monday, August 12, 2013 7:51 AM
  • There are two _different_ connection strings required for this.  A SQL Server connection string and a CSV file connection string.

    The SQL Server connection string should look like

    Data Source=MyServer;Initial Catalog=SomeDatabase;Integrated Security=SSPI

    or

    Data Source=MyServer\SomeInstance;Initial Catalog=SomeDatabase;Integrated Security=SSPI

    the CSV connection string should look like

    Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\folder\folder\;Extended Properties="text;HDR=Yes;FMT=Delimited";

    EG:

    using System;
    using System.Data;
    using System.Data.OleDb;
    using System.Data.SqlClient;
    using System.IO;
    
    namespace ConsoleApplication5
    {
      class Program
      {
        static void Main(string[] args)
        {
    
          string server = "localhost";
          string database = "tempdb";
          string SQLServerConnectionString = String.Format("Data Source={0};Initial Catalog={1};Integrated Security=SSPI", server, database);
         
    
          string CSVpath = @"C:\temp\"; // CSV file Path
          string CSVFileConnectionString = String.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};;Extended Properties=\"text;HDR=Yes;FMT=Delimited\";", CSVpath);
    
          var AllFiles = new DirectoryInfo(CSVpath).GetFiles("*.CSV");
          string File_Name = string.Empty;
    
          foreach (var file in AllFiles)
          {
            try
            {
              DataTable dt = new DataTable();
              using (OleDbConnection con = new OleDbConnection(CSVFileConnectionString))
              {
                con.Open();
                var csvQuery = string.Format("select * from [{0}]", file.Name);
                using (OleDbDataAdapter da = new OleDbDataAdapter(csvQuery, con))
                {
                  da.Fill(dt);
                }
              }
    
              using (SqlBulkCopy bulkCopy = new SqlBulkCopy(SQLServerConnectionString))
              {
                bulkCopy.ColumnMappings.Add(0, "Group");
                bulkCopy.ColumnMappings.Add(1, "ID");
                bulkCopy.ColumnMappings.Add(2, "Name");
                bulkCopy.ColumnMappings.Add(3, "Address");
                bulkCopy.ColumnMappings.Add(4, "Country");
                bulkCopy.DestinationTableName = "AllEmployees";
                bulkCopy.BatchSize = 0;
                bulkCopy.WriteToServer(dt);
                bulkCopy.Close();
              }
    
            }
            catch (Exception ex)
            {
             Console.WriteLine(ex.ToString());
            }
    
          }
        
    
        }
      }
    }


    David


    David http://blogs.msdn.com/b/dbrowne/


    Monday, August 12, 2013 2:56 PM
  • Thanks so much David.  I think I'm almost there.  However, now the code fails on this line:

    bulkCopy.WriteToServer(dt);

    This is the error message:

    Here's my code now . . .

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.IO;
    using System.Data.SqlClient;
    using System.Data.OleDb;
    using System.Configuration;

    namespace WindowsFormsApplication1
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }

            private void button1_Click(object sender, EventArgs e)
            {

                string server = "EXCEL-PC\\EXCELDEVELOPER";
                string database = "AdventureWorksLT2012";
                string SQLServerConnectionString = String.Format("Data Source={0};Initial Catalog={1};Integrated Security=SSPI", server, database);


                string CSVpath = @"C:\Users\Ryan\Documents\Visual Studio 2010\Projects\Bulk Copy from CSV to SQL Server Table\WindowsFormsApplication1\bin"; // CSV file Path
                string CSVFileConnectionString = String.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};;Extended Properties=\"text;HDR=Yes;FMT=Delimited\";", CSVpath);

                var AllFiles = new DirectoryInfo(CSVpath).GetFiles("*.CSV");
                string File_Name = string.Empty;

                foreach (var file in AllFiles)
                {
                    try
                    {
                        DataTable dt = new DataTable();
                        using (OleDbConnection con = new OleDbConnection(CSVFileConnectionString))
                        {
                            con.Open();
                            var csvQuery = string.Format("select * from [{0}]", file.Name);
                            using (OleDbDataAdapter da = new OleDbDataAdapter(csvQuery, con))
                            {
                                da.Fill(dt);
                            }
                        }

                        using (SqlBulkCopy bulkCopy = new SqlBulkCopy(SQLServerConnectionString))
                        {
                            bulkCopy.ColumnMappings.Add(0, "Group");
                            bulkCopy.ColumnMappings.Add(1, "ID");
                            bulkCopy.ColumnMappings.Add(2, "Name");
                            bulkCopy.ColumnMappings.Add(3, "Address");
                            bulkCopy.ColumnMappings.Add(4, "Country");
                            //bulkCopy.DestinationTableName = "AllEmployees";
                            bulkCopy.BatchSize = 0;
                            bulkCopy.WriteToServer(dt);
                            bulkCopy.Close();
                        }

                    }
                    catch(Exception ex)
                         {
                             MessageBox.Show(ex.Message, "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                         }
                }
            }
        }
    }


    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

    Tuesday, August 13, 2013 3:18 AM
  • The error message says that you need to set the DestinationTableName parameter. You have commented out the line which sets DestinationTableName.

    Could these be related?


    Paul Linton

    • Marked as answer by ryguy72 Wednesday, August 14, 2013 2:41 AM
    Tuesday, August 13, 2013 3:24 AM
  • Haha.  Yes.  I un-commented out that line.  Now I'm getting this . . .

    Here's the error message that I get now:



    Right before the error message, the focus is on this line:

    bulkCopy.WriteToServer(dt);



    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

    Tuesday, August 13, 2013 3:34 AM
  • You have 5 column mappings, at least one of them is wrong.  I can't think of anything else that the error message could mean.

    Paul Linton

    • Marked as answer by ryguy72 Wednesday, August 14, 2013 2:40 AM
    Tuesday, August 13, 2013 3:36 AM
  • I thought about that too.  However, I don't see what's wrong.  Do you see the probmem . . .

    It seems right to me, so I don't know why this thing is throwing an error.  After looking at my screen shots, any thoghts??


    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.


    • Edited by ryguy72 Tuesday, August 13, 2013 12:22 PM
    Tuesday, August 13, 2013 3:48 AM
  • If you are copying to SQL Server then the DestinationTableName will be a table in the database you are copying to.  Can you show that table definition?  In the column mappings, the second parameter is the name of the field in the destination but you seem to have shown columns from Excel which would be the source.

    Paul Linton

    • Marked as answer by ryguy72 Wednesday, August 14, 2013 2:40 AM
    Tuesday, August 13, 2013 3:55 AM
  • Ryan : Instead of putting the source data into a datatable open the source connection (CSV file) and use method shown on webpage below

    http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopy.aspx


    jdweng

    • Marked as answer by ryguy72 Wednesday, August 14, 2013 2:40 AM
    Tuesday, August 13, 2013 12:28 PM
  • The code fails on this line:

    bulkCopy.WriteToServer(dt);

    The error message is:
    The given ColumnMapping does not match up with any column in the source or destination.

    I'm stumped; Im just guessing as to what it could be.  This seemes like it should work.


    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

    Tuesday, August 13, 2013 12:30 PM
  • In the database you have 'Addres' with only one 's', your code has 'Address'.

    'Group' is not a good name for a column in SQL because 'Group' is a reserved word.  Notice how SSWS displays the name as '[Group]'.  It may cause you difficulties.


    Paul Linton

    • Marked as answer by ryguy72 Wednesday, August 14, 2013 2:40 AM
    Tuesday, August 13, 2013 12:52 PM
  • Thanks Joes, and thanks Paul. 

    Paul, I made the changes you suggested, also I noticed that my Group field, renamed to MyGroup, was originally Nvarchar(10) and I was passing in a string that was 13 characters long (NonEmployee).  I set the field to Nvarchar(50), re-ran the process, and it worked perfect.  Sloppy work on my part.

    All set now!!  Thanks guys!! 


    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

    Wednesday, August 14, 2013 2:44 AM