exec master..xp_cmdshell 'bcp "SELECT column1,column2 FROM 库..表名 where datediff(day,时间列,getdate())=0 " queryout c:\Authors.txt -c -t , -S Flysky -U sa -P 密码'
不能用扩展存储过程,启用
-- 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 master..xp_cmdshell 'bcp "SELECT column1,column2 FROM 库..表名 where datediff(day,时间列,getdate())=0 " queryout c:\Authors.txt -c -t , -S Flysky -U sa -P 密码'
不能用扩展存储过程,启用
-- 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