Red Gate forums :: View topic - SQL Data Generator & SQL 2008 Error
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Data Generator 1
SQL Data Generator 1 forum

SQL Data Generator & SQL 2008 Error

Search in SQL Data Generator 1 forum
Post new topic   Reply to topic
Jump to:  
Author Message
Giovanni8089



Joined: 16 Dec 2008
Posts: 1

PostPosted: Tue Dec 16, 2008 8:37 pm    Post subject: SQL Data Generator & SQL 2008 Error Reply with quote

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 )
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6588

PostPosted: Tue Dec 30, 2008 1:53 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6588

PostPosted: Mon Mar 23, 2009 4:58 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Girija



Joined: 14 Jul 2010
Posts: 2

PostPosted: Wed Jul 14, 2010 1:29 am    Post subject: SqlBulkCopy issue Reply with quote

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). Sad

Any help on this is appreciated most.
Back to top
View user's profile Send private message
Girija



Joined: 14 Jul 2010
Posts: 2

PostPosted: Wed Jul 14, 2010 1:58 am    Post subject: SqlBulkCopy issue - Resolved Reply with quote

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. : Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group