如何将数据从sqlserver存档到平面文件 [英] How to archive data from sqlserver to flat files

查看:103
本文介绍了如何将数据从sqlserver存档到平面文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我有一张像客户"这样的表,有10条记录.我想存档5条记录.
最后,我想执行该表,例如从客户中选择*",那么它将显示10条记录(5条记录在customer中,5条记录在arching位置).
是否可以获取所有记录?.

你能帮我吗?
预先感谢

Hello,

I have one table like ''customer'' with have 10 records. i want to archive in 5 records.
Finally i want to execute that table like ''select * from customer, then it will display 10 records(5 records are in customer and 5 records are in arching location).
is it possible to get all records..?

can you please help me.
thanks in advance

推荐答案

1)如果将表归档到相同的服务器和不同的数据库,则可以使用database.dbowner synatx检索结果.例如:-

从[服务器名称].[OriginalDatabase] .dbo中选择*.[OriginalTable]
合并所有
从[服务器名称]中选择*.[ArchivalDatabase] .dbo.[ArchivedTable]

2)如果已存档的数据库位于其他服务器中.请在sql中使用链接服务器选项,然后运行上面的查询.
1) If you archiving the table to the same server and different database, you can just retreive the results with a database.dbowner synatx. For Eg: -

select * from [Servername].[OriginalDatabase].dbo.[OriginalTable]
union all
select * from [Servername].[ArchivalDatabase].dbo.[ArchivedTable]

2) If the archived db is in different server. Please use the linked server option in sql and run the above query.


这篇关于如何将数据从sqlserver存档到平面文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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