Thanks for your advices !
I read that you don't have DTS in you SQL Express 2005. but in fact there is
a [hidden] way to have DTS in SQL Express 2005 :
Just Download SQL Express 2005 "TOOLKIT Edition" on MS Web site (the file is
: SQLEXPR_TOOLKIT.EXE). Install it on your computer. The DTS Wizard will be
installed in this path : C:\Program Files\Microsoft SQL
Server\90\DTS\Binn\DTSWizard.exe
You can easily add it in the Tool menu of the SQL Management Studio
Express.
Steph.
"Ignacio Machin ( .NET/ C# MVP )" <ig************@gmail.comwrote in
message
news:2a**********************************@d45g2000 hsc.googlegroups.com...
On Apr 2, 9:52 am, "TheSteph" <TheSt...@NoSpam.comwrote:
Using : MS-SQL 2005 / .NET 2.0 / VS2005
I have two server with the same database def but different data.
I would like to import data from Server2.TableA to Server1.TableA. If a
row
doesn't exists on Server1.TableA, it should be added; if the data already
exists it should be updated.
I have to write a C# application do this operation on a daily basis on
about
50 different tables.
- SqlBulkCopy : doesn't works because it can only do INSERT.
- DataTable.Load() : doesn't works because the destination table should be
entirely loaded into memory and it's too much data with some table.
I'm looking for something like SqlBulkCopy but it should handle the
UDPATE.
Does anybody have a simple solution to this problem ?
Thanks for your help !
Steph.
I have something similar to your escenario and this is what I do.
I do use DTS , not sqlbulk, to do the copying.
I do the copying to a temp table (staging table) in the DB
The last step in the app (after executing the DTS) is to execute a SP
that insert/update/delete the real table based on the imported table.
The only problem with that solution though, is that SQL Express 2005
does not support DTS so I have to use MSDE