Reputation: 3166
I have a Microsoft SQL Server instance Instance1
with a database called Maintenance
, with a table called TempWorkOrder
. I have another SQL Server instance Instance2
that has a database called MaintenanceR1
with a table called WorkOrder
.
Instance2
is a linked database on Instance1
. I want to copy any changed or new records from Instance2.MaintenanceR1.WorkOrder
to Instance1.Maintenance.TempWorkOrder
every hour.
I thought about creating a job that deletes all of the records in Instance1.Maintenance.TempWorkOrder
and repopulates it with Instance2.MaintenanceR1.WorkOrder
every hour. I am afraid this approach will let the log file get out of control as far as size goes.
Would I be better off dropping the table and re-creating it to keep the log file size reasonable? The table contains about 30,000 rows of data.
Upvotes: 1
Views: 43
Reputation: 8324
30,000 rows really shouldnt cause anything to get out of control. If you are really worried about log size, you can truncate instead of delete and bulk load with minimal logging your insert into the table.
https://www.mssqltips.com/sqlservertip/1185/minimally-logging-bulk-load-inserts-into-sql-server/
https://learn.microsoft.com/en-us/sql/t-sql/statements/truncate-table-transact-sql
Upvotes: 2