域名

sql server遍历用户表导出所有表数据到文本

字号+作者:益华科技来源:IT科技类资讯2025-11-04 06:28:26我要评论(0)

复制--Toallowadvancedoptionstobechanged. EXECsp_configureshowadvancedoptions,1

sql server遍历用户表导出所有表数据到文本
复制-- 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   ---xp_cmdshell cd C:Program FilesMicrosoft SQL Server90ToolsBin   xp_cmdshell dir *.exe   SELECT NAME,NAME FROM SYS.OBJECTS   xp_cmdshell bcp northwind.dbo.orders out c:mytest -T -c   declare @sql nvarchar(max)   set @sql= select @sql=@sql+ xp_cmdshell +bcp northwind.dbo.+quotename(name)+ out c:+name+.dat -T -c +  from sys.objects     where type=u;   select @sql   exec (@sql)  1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.

1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。

相关文章
  • 华硕U盘安装教程(通过华硕U盘安装系统,解决电脑系统问题的利器)

    华硕U盘安装教程(通过华硕U盘安装系统,解决电脑系统问题的利器)

    2025-11-04 06:18

  • 联想手机VibeX2(融合了颠覆性设计与卓越性能的联想VibeX2)

    联想手机VibeX2(融合了颠覆性设计与卓越性能的联想VibeX2)

    2025-11-04 05:31

  • 华硕飞行堡垒FX50J(华硕FX50J笔记本电脑的性能、外观及使用体验评测)

    华硕飞行堡垒FX50J(华硕FX50J笔记本电脑的性能、外观及使用体验评测)

    2025-11-04 05:25

  • 联想310s141kb的性能与特点剖析(揭秘联想310s141kb的设计、配置与优势)

    联想310s141kb的性能与特点剖析(揭秘联想310s141kb的设计、配置与优势)

    2025-11-04 04:03

网友点评