使用xp_cmdshell组件实现.
1.启用xp_cmdshell;
2.编写sql
EXEC master..xp_cmdshell 'bcp [dbname].dbo.[tablename] out "c:\temp.xls " /c /S "192.168.0.123" /U "sa" -P "123456"'
参考http://www.hugesky.com/htm/bianchengjiqiao/netbianchengjiqiao/showarticle_id3820.htm