各位大哥,小弟最近需要做一个关于 sql 导入导出 dbf 数据库的东西
本来已经成功了,但是到客户端测试的时候发现把数据都导入到服务器端了,导出也一样,
请问怎样把数据从SQL服务器中导出到本地的dbf中我用的语句是导入dbf:insert into
openrowset('MSDASQL','Driver=Microsoft Visual FoxPro Driver;SourceType=DBF;SourceDB=c:','select * from cbdata.dbf')
select cmendid,cCustcardno,ccuscode,substring(ccusname,1,5),caddress,ccgcode,ilreaddata,ireaddata,iquantity,bcopy
from tempwatercopy order by ccuscode asc
从dbf导出:
insert into tempwatercopy(cmendid,cCustcardno,ccuscode,ccusname,caddress,ccgcode,ilreaddata,ireaddata,iquantity,bcopy)
select cmendid,ltrim(rtrim(ccardno)),ltrim(rtrim(ccuscode)),ltrim(rtrim(ccusname)),ltrim(rtrim(caddress)),
ltrim(rtrim(ccgcode)),ilreaddata,ireaddata,iquantity,bcopy
from openrowset('MSDASQL','Driver=Microsoft Visual FoxPro Driver;SourceType=DBF;SourceDB=c:','select * from cbdata.dbf')
本来已经成功了,但是到客户端测试的时候发现把数据都导入到服务器端了,导出也一样,
请问怎样把数据从SQL服务器中导出到本地的dbf中我用的语句是导入dbf:insert into
openrowset('MSDASQL','Driver=Microsoft Visual FoxPro Driver;SourceType=DBF;SourceDB=c:','select * from cbdata.dbf')
select cmendid,cCustcardno,ccuscode,substring(ccusname,1,5),caddress,ccgcode,ilreaddata,ireaddata,iquantity,bcopy
from tempwatercopy order by ccuscode asc
从dbf导出:
insert into tempwatercopy(cmendid,cCustcardno,ccuscode,ccusname,caddress,ccgcode,ilreaddata,ireaddata,iquantity,bcopy)
select cmendid,ltrim(rtrim(ccardno)),ltrim(rtrim(ccuscode)),ltrim(rtrim(ccusname)),ltrim(rtrim(caddress)),
ltrim(rtrim(ccgcode)),ilreaddata,ireaddata,iquantity,bcopy
from openrowset('MSDASQL','Driver=Microsoft Visual FoxPro Driver;SourceType=DBF;SourceDB=c:','select * from cbdata.dbf')
数据库处理的sql语句如备份或导出 默认就是在服务器本地所在机子上 要弄到客户端好像不好弄,上次遇到过,没解决掉,后来只有通过 ftp处理
而且考慮到數據庫大小,和處理數據時間,一般都在本地作,然後拷貝到
擁有讀寫權限目標地址去