Slow Update to Remote Database
i'm having trouble finding quick way update on large amount of data to a remote database.
in situation, data taken table, , updated external service (ncoa, corrects address data), , sent in sdf text file. need take data , update orginal table data in sdf file. problem orginal database on remote server, and i'm not allowed import data tempoary table there update join on tempoary table (which quick.)
currently, i'm using c# ado.net connect database, load sdf locally, pull data each record, build update command, , execute each 1 separately. extremely slow (~4 records updated per second), , there can on million records need updated, method not acceptable. have tried pulled multiple update commands in single command object before executing it, doesn't improve speed @ all.
does know how can quicker bulk update remote database this?
thanks,
brian2344
in situation, data taken table, , updated external service (ncoa, corrects address data), , sent in sdf text file. need take data , update orginal table data in sdf file. problem orginal database on remote server, and i'm not allowed import data tempoary table there update join on tempoary table (which quick.)
currently, i'm using c# ado.net connect database, load sdf locally, pull data each record, build update command, , execute each 1 separately. extremely slow (~4 records updated per second), , there can on million records need updated, method not acceptable. have tried pulled multiple update commands in single command object before executing it, doesn't improve speed @ all.
does know how can quicker bulk update remote database this?
thanks,
brian2344
yep - should if create staging table data, bulk insert or bcp staging table, create appropriate indexes on staging table, , update within sql server. you'll still want batch records - can more 1000 or 10000 records @ time way. create sproc handle update, , truncate , refill staging table text file.....but again, i'm db guy. there's nothing wrong doing bcp/bulk insert via ado.net, put entire update proc in sql server.
do need more specific information on of steps? i'll happy provide - let me know.
aaron alton | thehobt.blogspot.com
do need more specific information on of steps? i'll happy provide - let me know.
aaron alton | thehobt.blogspot.com
SQL Server > SQL Server Data Access
Comments
Post a Comment