I would suggest to setup a bcp batch job using SQLAgent, providing the jobstep proxy account only with the needed authorisation to read the source data and write to the destination instance.
I would not use a linked server to implement that, because of the risk of abuse.
Intentions now are good and can be implemented using a linked server, but once a linked server definition is in place, everyone can use it and then the impact may overgrow the intended one and servers will actually become depentent. That would mean apps using the target server may not work if you take the source server down for e.g. maintenance, ...
example bcp sequence:
rem Create format files
bcp yourdb.yourschema.yourtable format NUL -fc:\ImportExport\SourceInstance_yourschema.yourtable.fmt -S SourceInstance\SourceInstance -T -n -o c:\ImportExport\SourceInstance_yourschema.yourtable_fmt.log
rem delete data via SQLCMD only if needed / consider Truncate table
rem sqlcmd -S TargetInstance -d yourDB -E -Q "delete from yourschema.yourtable;" -o "c:\ImportExport\TargetInstance_yourDB_delete_yourschema.yourtable.Log"
rem Import data IN HIARARCHICAL ORDER !!!
bcp yourDB.yourschema.yourtable in c:\ImportExport\SourceInstance_yourschema.yourtable.bcp -fc:\ImportExport\SourceInstance_yourschema.yourtable.fmt -S TargetInstance -T -CRAW -k -E -h"TABLOCK,CHECK_CONSTRAINTS" -o c:\ImportExport\DEV01_LOAD_yourDB_yourschema.yourtable.log
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere
- How to post Performance Problems
- How to post data/code to get the best help
- How to prevent a sore throat after hours of presenting ppt ?press F1 for solution, press shift+F1 for urgent solution
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me
but most of the time this is me