日本黄色一级经典视频|伊人久久精品视频|亚洲黄色色周成人视频九九九|av免费网址黄色小短片|黄色Av无码亚洲成年人|亚洲1区2区3区无码|真人黄片免费观看|无码一级小说欧美日免费三级|日韩中文字幕91在线看|精品久久久无码中文字幕边打电话

當(dāng)前位置:首頁 > 芯聞號 > 充電吧
[導(dǎo)讀]-- ======================================================T-SQL代碼:EXEC master..xp_cmdshell 'bcp 庫名.db

-- ======================================================
T-SQL代碼:
EXEC master..xp_cmdshell 'bcp 庫名.dbo.表名out c:/Temp.xls -c -q -S"servername" -U"sa" -P""'
參數(shù):S 是SQL服務(wù)器名;U是用戶;P是密碼
EXEC master..xp_cmdshell 'bcp axzq.dbo.Staff out d:staff.xls -c -q -S"." -U"sa" -P"gazx"'
說明:還可以導(dǎo)出文本文件等多種格式
實(shí)例:EXEC master..xp_cmdshell 'bcp saletesttmp.dbo.CusAccount out c:/temp1.xls -c -q -S"pmserver" -U"sa" -P"sa"'
EXEC master..xp_cmdshell 'bcp "SELECT au_fname, au_lname FROM pubs..authors ORDER BY au_lname" queryout C:/ authors.xls -c -Sservername -Usa -Ppassword'
EXEC master..xp_cmdshell 'bcp "select name from axzq..staff order by name" ?queryout d:staffName.xls -c -q -S"." -U"sa" -P"gazx"'
------------------------------------------------------------------------------------------------
2、在SQL SERVER里往Excel插入數(shù)據(jù):
-- ======================================================
insert into OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="c:/Temp.xls";User ID=Admin;Password=;Extended properties=Excel 5.0')...table1 (A1,A2,A3) values (1,2,3)
T-SQL代碼:
INSERT INTO ?
OPENDATASOURCE('Microsoft.JET.OLEDB.4.0', ?
'Extended Properties=Excel 8.0;Data source=C:/training/inventur.xls')...[Filiale1$] ?
(bestand, produkt) VALUES (20, 'Test')

本站聲明: 本文章由作者或相關(guān)機(jī)構(gòu)授權(quán)發(fā)布,目的在于傳遞更多信息,并不代表本站贊同其觀點(diǎn),本站亦不保證或承諾內(nèi)容真實(shí)性等。需要轉(zhuǎn)載請聯(lián)系該專欄作者,如若文章內(nèi)容侵犯您的權(quán)益,請及時聯(lián)系本站刪除( 郵箱:macysun@21ic.com )。
換一批
延伸閱讀
關(guān)閉