使用sql語句匯入 匯出 資料為Excel

2021-04-13 12:54:26 字數 588 閱讀 2929

匯出資料為excel:

exec master..xp_cmdshell

'bcp fsebss.dbo.resource_goodstype out c:/temp1.xls -c -q -s"yysoft-468er27v(sql伺服器名稱)"

-u"sa(登入名)" -p"111111(密碼)"'

從excel中匯入資料:

insert into vpmn_baseinforlist_ml(bi_baseshopno,bil_baseshoplistno,bil_name,bil_jobs,bil_tel)

select (left(成員編號,11)) '合作商編號',(left(成員編號,11)+right(成員編號,3)) '成員編號',姓名,職位,convert(varchar(50),手機號碼,120)

from opendatasource('microsoft.jet.oledb.4.0','data source="c:/pp.xls";

user id=admin;password=;extended properties=excel 8.0')...[sheet2$] where 姓名 is not null 

匯入匯出sql語句

expdp 匯出 create directory dpdata1 as d test dump 建立目錄 grant read,write on directory dpdata1 to scott 賦予許可權 select from dba directories 查詢目錄 要在c盤建立test...

SQL語句匯入匯出大全

源 不管是把sql server表的資料插入excel insert into openrowset microsoft.jet.oledb.4.0 excel 5.0 hdr yes database c test.xls test select from t test 還是把excel的資料插入...

SQL語句匯入匯出Excel

匯出到excel exec master.xp cmdshell bcp settledb.dbo.shanghu out c temp1.xls c q s gnetdata gnetdata u sa p 匯入excel select from opendatasource microsoft....