zoukankan      html  css  js  c++  java
  • sql 导出大数据量 到excel

    首先开启 xp_cmdshell

    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

    在f盘新建一个222.xls文件,执行下面语句

    use master
    declare @cmd varchar(5000) 
    set   @cmd= 'bcp   "select * from DBName.dbo.DrugList"   queryout   "F:\222.xls "   -c   -T ' 
    exec   master..xp_cmdshell @cmd
  • 相关阅读:
    10
    9
    8
    第七章
    第五章
    第六章
    android深度探索第四章
    android深度探索第三章
    android深度探索第二章
    android深度探索第一章
  • 原文地址:https://www.cnblogs.com/coolkiss/p/2135897.html
Copyright © 2011-2022 走看看