开发者

Bring data periodically from Linked Database in SQLServer 2008

We are developing a system on PHP with SQL Server 2008. Is a system that must work with the invoices stored in another SQL Server instance, that I have linked to my Database开发者_Python百科 using sp_addlinkedserver.

The problem is that I think I need to have it loaded locally (because of performance). Si I'm thinking to make a my own "invoices" table, and two times per day somehow bring the data from the linked table to the locally stored one.

How can I program SQL to do this every X amount of time? What approach I should use to program the importing?

It first I though to make my own script to do this, but I would preffer to have SQL Server to handle this, but that depends on your opinion :)

Thnak you! Guillermo

NOTE: Replication sounds overkill for me.. I dont need to have real-time synconization. Neither I need to update the database, just read.


One option is to use replication to copy the data. However, it may take more administration than you're planning. Replication is great for managing a consistent and timely copy of the data.

Another option is to setup a SQL Server job that will run a SQL script to insert into your target table using a select from your linked server.

You could also use SQL Server Integration Services (SSIS). You would create a SSIS package where you would build a data flow that transfers your data from the source table to the target table. You wouldn't need a linked server for this approach, because your data sources are defined within the SSIS package. And, you can use a SQL Server job to schedule the package run times.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜