好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

SQLServer数据库bcp导出备份文件应用示例

/**
* 授权
*/
EXEC sp_configure 'show advanced options',1;
go
reconfigure;
go
exec sp_configure 'xp_cmdshell',1;
go
reconfigure;
go

/**导入指定表的文本文件*/
EXEC master..xp_cmdshell 'bcp dbname..tablename in d:\DT.txt -c -Sservername -Usa -Ppassword'
exec master..xp_cmdshell 'bcp "select * from dbname..tablename" queryout "D:\20140528.xls"-c -Sservername -Uuser -Ppassword' 

查看更多关于SQLServer数据库bcp导出备份文件应用示例的详细内容...

  阅读:55次