What are the challenges you face when working across database platforms? Take the survey
Options

SQL Data Generator & SQL 2008 Error

I’m having an issue with a licensed copy of Data Generator 1.2.0.286 and SQL Server 2008. When I Generate Data I receive the following error message for all tables that belong to a custom schema. All tables belonging to the dbo schema work fine.

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).
System.InvalidOperationException: 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).
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) at az.a(CancellableController , Int32 ,
Int32 , ConnectionProperties , GenerateAction , SqlConnection , SDGProject , GenerationReport )

Comments

  • Options
    Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hi,

    There seems to be a bug in SQL Data Generator when the schema name contains a dot character, for instance a schema called [My.Schema] would introduce this problem.

    This should be fixed in a future version.
  • Options
    Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Correction -- the bug seems to be in the .NET Framework.

    http://support.microsoft.com/kb/944389

    The BulkInsert methods of the native SQL client for .NET can't handle table names with a dot in them.
  • Options
    I am getting following error when I try to import excel sheet to SQL server.
    I didn't use dot in the table name and it used to work fine before and I didn't make any changes to application. Microsoft article says problem arises if we fully qualified table name, but I am not using schema name with table name. http://support.microsoft.com/kb/944389

    ex: string destTblName = "tbJobResponseIdsRaw";
    SqlBulkCopy bulkCopy = new SqlBulkCopy(conn.ConnectionString);
    bulkCopy.DestinationTableName = destTblName;

    Error:
    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). :(

    Any help on this is appreciated most.
  • Options
    I think issue is resolved by granting view permission on tables.
    It seems recently the application user was denied permissions to view table definition even though the user got read/write access on the tables. SQLBlkcopy seems to be trying to view the table definition and when it can't view it is throwing this exception error (misleading .. not properly described)...
    Hope it might help anyone with similar issue. : :)
Sign In or Register to comment.