SQL SERVER ->> BCP导出数据到平面文件

--开启xp_cmdshell
sp_configure ‘show advanced options’, 1;
GO
RECONFIGURE;
GO
sp_configure ‘xp_cmdshell’, 1; --Switch on specific functionality
GO
RECONFIGURE;
GO --Tab作为行分隔符,\n作为断行符 导出到H盘
EXECUTE master.dbo.xp_cmdshell 'bcp "SELECT TOP 20 PERCENT * FROM MyDB.dbo.table_name" queryout H:\table_name.dat -c -T'
上一篇:Oracle asm介绍和安装linux+oracle10g+asm过程


下一篇:Redis介绍、安装部署、操作