日期:2014-05-17 浏览次数:20576 次
-- To allow advanced options to be changed.
EXEC sp_configure 'show advanced options', 1
GO
-- To update the currently configured value for advanced options.
RECONFIGURE
GO
-- To enable the feature.
EXEC sp_configure 'xp_cmdshell', 1
GO
-- To update the currently configured value for this feature.
RECONFIGURE
GO
EXEC sp_configure 'xp_cmdshell', 1
GO
EXEC master..xp_cmdshell 'bcp "SELECT top 100 * FROM 数据库名.dbo.表名" queryout "d:\1.txt" -c -t \t -S"localhost\sqlexpress" -U"sa" -P"12345" '