Microsoft small business knowledge base

Article ID: 944389 - Last Review: January 16, 2015 - Revision: 3.0

This article has been archived. It is offered "as is" and will no longer be updated.

On This Page


In a Microsoft .NET Framework 2.0 application, you use the SqlBulkCopy class to copy data from a System.Data.DataTable to a table in Microsoft SQL Server. If the table name contains a dot character (.), you receive the following error message:
System.InvalidOperationException was unhandled
Message="Failed to obtain column collation information for the destination table. If the table is not in the current database the name must be qualified using the database name (e.g. [mydb]..[mytable](e.g. [mydb]..[mytable]); this also applies to temporary-tables (e.g. #mytable would be specified as tempdb..#mytable)."


This problem is caused by an issue in the System.Data.dll file.


To work around this problem, avoid dot characters (.) in table names.

If you have to use a dot character (.) in a table name, use the dot character (.) as part of the SQL naming convention. For example, use a table name that resembles the following:


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

More information

Steps to reproduce the behavior

  1. In the Northwind database, run the following SQL statement:
    select * into [test.33] where 1 = 0
    --Create a table named [test.33].
  2. Create a Visual C# application, and then run the following code:
    static void Main(string[] args)
                SqlConnection con = new SqlConnection("Integrated Security=SSPI;Initial Catalog=Northwind;Data Source=.");
                SqlConnection dst = new SqlConnection("Integrated Security=SSPI;Initial Catalog=Northwind;Data Source=.");
                SqlCommand com = new SqlCommand("select * from customers", con);
                SqlDataReader dr = com.ExecuteReader();
                SqlBulkCopy sbc = new SqlBulkCopy(dst);
                sbc.DestinationTableName = "Northwind.dbo.[Test.33]";
                sbc.WriteToServer(dr); // The failure occurs here.

Call stack information

at System.Data.SqlClient.SqlBulkCopy.AnalyzeTargetAndCreateUpdateBulkCommand(BulkCopySimpleResultSet internalResults)
       at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternal()
       at System.Data.SqlClient.SqlBulkCopy.WriteRowSourceToServer(Int32 columnCount)
       at System.Data.SqlClient.SqlBulkCopy.WriteToServer(IDataReader reader)

Applies to
  • Microsoft .NET Framework 2.0
  • Microsoft .NET Framework 3.0
  • Microsoft .NET Framework 3.5
kbnosurvey kbarchive kbexpertiseadvanced kbtshoot kbprb KB944389
Additional support options
Ask The Microsoft Small Business Support Community
Contact Microsoft Small Business Support
Find Microsoft Small Business Support Certified Partner
Find a Microsoft Store For In-Person Small Business Support