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

推荐订阅源

V
V2EX
小众软件
小众软件
GbyAI
GbyAI
B
Blog RSS Feed
月光博客
月光博客
A
About on SuperTechFans
Microsoft Security Blog
Microsoft Security Blog
Blog — PlanetScale
Blog — PlanetScale
U
Unit 42
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
Recent Announcements
Recent Announcements
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Vercel News
Vercel News
F
Fortinet All Blogs
Apple Machine Learning Research
Apple Machine Learning Research
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
雷峰网
雷峰网
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
Engineering at Meta
Engineering at Meta
aimingoo的专栏
aimingoo的专栏
博客园_首页
G
Google Developers Blog

博客园 - 凬月

DIV+CSS中标签dl dt dd常用的用法 使用gulp构建一个项目 (转)利用CAS算法实现通用线程安全状态机 棋牌游戏服务器架构设计 STM32F103引脚功能定义 STM32的型号的命名规则 关闭jtag保留swd 微信支付----维权接口开发!(转掌眼) 微信支付--入门篇(转掌眼) LoadRunner培训初级教程 [转]在windows环境中使用varnish squid-nginx 基本配置 redis windows下的环境搭建 显示数据库中所有表的记录数 一个带标号的CSS文章列表写法 CSS图片列表 YUI3 CSS Ubuntu 13.10 64位 无法 安装 ia32-libs 解决办法 [转]编译Android源代码常见错误解决办法
删除MSSQL数据库中所有表
凬月 · 2015-01-17 · via 博客园 - 凬月
--删除所有约束  
DECLARE c1 cursor for  
    select 'alter table ['+ object_name(parent_obj) + '] drop constraint ['+name+']; '  
    from sysobjects  
    where xtype = 'F'  
open c1  
declare @c1 varchar(8000)  
fetch next from c1 into @c1  
while(@@fetch_status=0)  
    begin  
        exec(@c1)  
        fetch next from c1 into @c1  
    end  
close c1  
deallocate c1  
--删除数据库所有表  
declare @tname varchar(8000)  
set @tname=''  
select @tname=@tname + Name + ',' from sysobjects where xtype='U'  
select @tname='drop table ' + left(@tname,len(@tname)-1)  
exec(@tname)  

posted @ 2015-01-17 16:30  凬月  阅读(427)  评论()    收藏  举报