473,407 Members | 2,320 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

SqlBulkCopy.WriteToServer SqlException

Using SqlBulkCopy.WriteToServer to upload a datatable and getting:

System.Data.SqlClient.SqlException
Line 1: Incorrect syntax near 'COLLATE'.

Database Server is SQL2000, database in in 6.5 compatibility mode.

No error when targeting SQL2000 database in 8.0 compatibility mode.

Is this specific to 6.5 and is there a workaround?

thanks,
scott

Aug 31 '06 #1
1 3608
Found a workaround:

If databases on same server, connect to 8.0 database, and preface the
SqlBulkCopy table name with the 6.5 database name.

example:
string connectionString = "Data Source=MySQLServer2000;Initial
Catalog=database80;Integrated Security=True";
using (SqlBulkCopy bcp = new SqlBulkCopy(connectionString))
{
bcp.DestinationTableName = "database65..destination_table";
bcp.WriteToServer(mydatatable);
}

"harleedavidson" <ha************@nospam.nospamwrote in message
news:e7*************@TK2MSFTNGP03.phx.gbl...
Using SqlBulkCopy.WriteToServer to upload a datatable and getting:

System.Data.SqlClient.SqlException
Line 1: Incorrect syntax near 'COLLATE'.

Database Server is SQL2000, database in in 6.5 compatibility mode.

No error when targeting SQL2000 database in 8.0 compatibility mode.

Is this specific to 6.5 and is there a workaround?

thanks,
scott

Sep 1 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Roy | last post by:
For SqlBulkCopy class, is there a way to add columns that are not persisted when WriteToServer(DataTable) is called? I have information to be cache temperarily with the record and not need to be...
1
by: GB | last post by:
Hello: I am developing C# project, using ADO .NET 2.0 to connect to SQL Server 2005. I created a DataTable from scratch, and then use SqlBulkCopy to insert it into an empty table in a SQL Server...
0
by: Oscar Thornell | last post by:
Hi, I am trying to enlist an instance of SqlBulkCopy into a transaction. When I executes and try to write to the database IŽll get an exception indicating a transactional deadlock. ...
0
by: Cwappy | last post by:
I have a class that builds a DataTable and then, when the process is exiting, tries to write that DataTable to SQL Server 2000 via the SqlBulkCopy class. I know the process is exiting because I'm...
3
by: fingermark | last post by:
If it's possible, can someone tell me how I could ignore and log SqlBulkCopy duplicate key errors? So, if the bulkCopy.WriteToServer(dt); errors on duplicate key, I want it to log what the row...
4
by: Chris | last post by:
I have created a datatable from a csv file. One of the columns is an integer which sometimes can be blank. When it is blank I add a dbnull.value to the column when I add to the datatable. This...
1
by: Dave | last post by:
I'm using the SqlBulkCopy object to bulk insert large DataTable's into SQL Server. Its working well except tables with IDENTITY columns in them. When calling...
2
by: Amar | last post by:
Hi, I need to insert a large amount of records pretty frequently through my application. The quickest way to achive this seems to be SQLBulkcopy class. I have implemented the solution using the...
1
by: Sergey Zenyuk | last post by:
In VB.net windows application I use following code implementing SqlBulkCopy import: Using connODBC As New OdbcConnection(ConnStrODBC) connODBC.Open() Dim dbcmd As New OdbcCommand(String....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.