惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 聂微东
博客园_首页
M
MIT News - Artificial intelligence
Project Zero
Project Zero
C
CXSECURITY Database RSS Feed - CXSecurity.com
V2EX - 技术
V2EX - 技术
G
Google Developers Blog
H
Hacker News: Front Page
N
Netflix TechBlog - Medium
Martin Fowler
Martin Fowler
GbyAI
GbyAI
C
Cisco Blogs
www.infosecurity-magazine.com
www.infosecurity-magazine.com
酷 壳 – CoolShell
酷 壳 – CoolShell
The Hacker News
The Hacker News
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Simon Willison's Weblog
Simon Willison's Weblog
A
Arctic Wolf
H
Heimdal Security Blog
量子位
小众软件
小众软件
Help Net Security
Help Net Security
博客园 - Franky
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
N
News | PayPal Newsroom
T
Tor Project blog
Google DeepMind News
Google DeepMind News
Y
Y Combinator Blog
N
News and Events Feed by Topic
T
Tailwind CSS Blog
Webroot Blog
Webroot Blog
J
Java Code Geeks
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Hugging Face - Blog
Hugging Face - Blog
罗磊的独立博客
The Register - Security
The Register - Security
D
DataBreaches.Net
Blog — PlanetScale
Blog — PlanetScale
有赞技术团队
有赞技术团队
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
腾讯CDC
P
Palo Alto Networks Blog
S
Secure Thoughts
D
Darknet – Hacking Tools, Hacker News & Cyber Security
TaoSecurity Blog
TaoSecurity Blog
Scott Helme
Scott Helme
T
Tenable Blog
C
Cybersecurity and Infrastructure Security Agency CISA
D
Docker
美团技术团队

博客园 - 谢小漫

弹出选择窗体控件(附源码) 获取枚举描述信息(Description)2 - 谢小漫 - 博客园 mshtml组件引用的问题 Sql Server数据导出EXCEL C#的串口编程 DataReceived XML-RPC.NET的X509Certificates如何使用呢 XML-RPC.NET 在读《C#和.NET 2.0实战》 如何在ASP.NET中做异步 如何在winform中用委托做异步 C#的串口编程 重新开始学习.net 在看Test-Driven Development In Microsoft .NET 最近了解过的一个支付接口 网站的第三天 BAIDU的第一个搜索访问进入网站 不错的日期选择 星期六提交sitemap 关于代码自动生成器
导出所有用户表到excel
谢小漫 · 2009-04-30 · via 博客园 - 谢小漫

导出所有用户表到excel,结合上一个发的存储过程。

/*-- 
导出所有用户表到excel
--
*/
CREATE proc 导出所有用户表
as DECLARE @tb_name varchar(300)DECLARE tbname_cursor CURSOR FOR
select o.name from dbo.sysobjects o 
where OBJECTPROPERTY(o.id, N'IsUserTable'= 1 
and o.name<>'dtproperties'
order by o.nameOPEN tbname_cursor-- Perform the first fetch and store the values in variables.
--
 Note: The variables are in the same order as the columns
--
 in the SELECT statement. 

FETCH NEXT FROM tbname_cursor
INTO @tb_name-- Check @@FETCH_STATUS to see if there are any more rows to fetch.
WHILE @@FETCH_STATUS = 0
BEGIN--导出所有用户表
   exec('p_exporttb @sqlstr=''select * from '+@tb_name+' '',@path=''c:\abc'',@fname='''+@tb_name+'.xls'',@sheetname='''+@tb_name+'''')FETCH NEXT FROM tbname_cursor
   
INTO @tb_nameENDCLOSE tbname_cursor
DEALLOCATE tbname_cursor