sql2000导出资料表到txt,运行以下T-sql就死机
资料表里就几条记录,但导出到txt运行以下T-sql就死机.请大家帮忙,谢谢!
DECLARE @sql varchar(100)
SET @sql = 'bcp "EXECUTE select username,usertel xyw.dbo.userinfo " queryout d:\my '+ CONVERT(VARCHAR(10), getdate(), 112) + '.txt -c -S(local) -U sa -P 123456 '
SELECT @sql EXEC master..xp_cmdshell @sql
------解决方案--------------------DECLARE @sql varchar(100)
SET @sql = 'bcp "select username,usertel from xyw.dbo.userinfo " queryout d:\my '+ CONVERT(VARCHAR(10), getdate(), 112) + '.txt -c -S(local) -Usa -P123456 '
SELECT @sql
EXEC master..xp_cmdshell @sql
------解决方案--------------------EXEC master..xp_cmdshell 'bcp.exe "Select * from dbname.dbo.userinfo " queryout D:\DT.txt -c -S(local) -Usa -P123456 '
--这样可以