RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
sqlserver遍历用户表导出所有表数据到文本

sql server遍历用户表相信大家都有一些了解,下面为您介绍的是sql server遍历用户表导出所有表数据到文本文件的方法,希望对您学习sql server遍历用户表方面能有所帮助。

10年积累的成都网站建设、成都做网站经验,可以快速应对客户对网站的新想法和需求。提供各种问题对应的解决方案。让选择我们的客户得到更好、更有力的网络服务。我虽然不认识你,你也不认识我。但先网站制作后付款的网站建设流程,更有分宜免费网站建设让你可以放心的选择与我们合作。

 
 
 
  1. -- To allow advanced options to be changed.
  2. EXEC sp_configure 'show advanced options', 1
  3. GO
  4. -- To update the currently configured value for advanced options.
  5. RECONFIGURE
  6. GO
  7. -- To enable the feature.
  8. EXEC sp_configure 'xp_cmdshell', 1
  9. GO
  10. -- To update the currently configured value for this feature.
  11. RECONFIGURE
  12. GO
  13. ---xp_cmdshell 'cd C:Program FilesMicrosoft SQL Server90ToolsBin'
  14. xp_cmdshell 'dir *.exe'
  15. SELECT NAME,NAME FROM SYS.OBJECTS
  16. xp_cmdshell 'bcp northwind.dbo.orders out c:mytest -T -c'
  17. declare @sql nvarchar(max)
  18. set @sql=''
  19. select @sql=@sql+' xp_cmdshell '+'''bcp northwind.dbo.'+quotename(name)+' out c:'+name+'.dat -T -c '+''' ' from sys.objects  
  20. where type='u';
  21. select @sql
  22. exec (@sql)

网页题目:sqlserver遍历用户表导出所有表数据到文本
本文网址:http://jxjierui.cn/article/coehohg.html