sqlServer導出到外部(excel、txt等)

EXEC sp_configure N'show advanced options', N'1' 
RECONFIGURE WITH OVERRIDE
EXEC sp_configure N'xp_cmdshell', N'1'
RECONFIGURE WITH OVERRIDE 
EXEC sp_configure N'show advanced options', N'0' 
RECONFIGURE WITH OVERRIDE


EXEC master..xp_cmdshell 'bcp "SELECT * FROM  [AirTicket].dbo.[tb]" queryout "F:\data.xls" -c -t -T '

在這裏插入圖片描述

更多:https://blog.csdn.net/qq_42229253/article/details/81123822

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章