将数据从远程MDF引入sql server [英] bring in data from remote MDF to sql server

查看:56
本文介绍了将数据从远程MDF引入sql server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,这是快速版。我在远程计算机上(在处理工厂中)有一个.MDF文件,其上有软件,是第三方自定义构建的,我无法访问代码。它将其数据存储在本地硬盘驱动器上的.MDF数据库文件中。我需要一种方法将每天的数据复制到我的sqlserver以进行报告。



有人能指出我正确的方向吗?我的google foo今天没有得到答案。我不需要有人为我编写代码,只需要在正确的路径上指示如何执行此操作。



我正在考虑存储过程我的sql服务器每天都在班次结束时伸出来并简单地复制天数据?但是我怎么能指出那个发臭的孤儿.MDF文件呢?远程计算机上没有安装完整的sql,也不能在此时安装。是的我可以访问MDF并可以手动复制并连接到我的sql server而没有任何问题,但我需要一种方法来每天获取数据,而不是每天手动执行此操作。

谢谢提前耐心和任何帮助。

Ok here is the quick version. I have a .MDF file on a remote computer(in the processing plant) this has software on it that is third party custom built and I have no access to the code. It stores its data in a .MDF database file on its local hard Drive. I need a method to copy that data on a daily basis to my sqlserver for the purpose of reporting.

Can somebody point me in the right direction? my google foo is not coming up with the answer today. I do not need somebody to write the code for me, just a pointer down the right path on how to do this.

I''m thinking a stored proc on my sql server that reaches out every day at end of shift and simply copies the days data over? But how can I point to that stinking orphaned .MDF file? full sql is not installed on the remote computer, nor can it be at this point. Yes I do have access to the MDF and can copy it manually and attach to my sql server with no trouble, but I need a way to get the data daily, not manually do this every day.
Thanks in advance for your patience and any help given.

推荐答案





你可以创建简单的控制台从MDF文件读取数据并在sql数据库中插入类似数据的应用程序。你需要两个连接字符串1连接MDF文件和另一个连接SQL Server服务器。



现在下一步是在任务计划程序中添加此应用程序并设置间隔根据您的需要执行。



i认为这是完成工作的最简单方法



祝你好运
Hi,

you can create simple console application that reads data from the MDF file and insert similar data in your sql database. you need two connection string one to connect with MDF file and another to connect with SQL server.

Now next step is to add this application in Task Scheduler and set the interval for execution as per your need.

i think this is the easiest way to get your work done

best luck


这篇关于将数据从远程MDF引入sql server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆