SQL删除有默认值字段(转)
declare @dfname varchar(50)
select @dfname=a.name
from sysobjects a
inner join syscomments b on a.id=b.id
inner join sysconstraints c on c.constid=a.id
inner join syscolumns d on c.colid=d.colid and c.id=d.id
where a.xtype='D' and object_name(d.id)='表名' and d.name='列名'
if @dfname is not null
exec('alter table 表名 drop constraint '+@dfname)
Go
alter table 表名 drop column 列名
Go
相关文档:
系统环境:Windows 7
软件环境:Visual C++ 2008 SP1 +SQL Server 2005
本次目的:编写一个航空管理系统
这是数据库课程设计的成果,虽然成绩不佳,但是作为我用VC++ 以来编写的最大程序还是传到网上,以供参考。用VC++ 做数据库设计并不容易,但也不是不可能。以下是我的程序界面,后面 ......
在入门篇,我们学会了SQL注入的判断方法,但真正要拿到网站的保密内容,是远远不够的。接下来,我们就继续学习如何从数据库中获取想要获得的内容,首先,我们先看看SQL注入的一般步骤:
第一节、SQL注入的一般步骤
首先,判断环境,寻找注入点,判断数据库类型,这在入门篇已经讲过了。
其次,根据注入 ......
来自:http://www.cnblogs.com/mikeye/archive/2007/04/13/711878.html
和来自:http://tech.ccidnet.com/art/3539/20080225/1370107_1.html
用eclipse来进行Microsoft SQL Server 2005数据库方面的开发,先把MS SQL Server 2005 JDBC Driver的驱动下载后加入工程文件的类库中;然后写URL字符串。根据以往的写法写入:url = ......
HO~HO~EXCEL生成SQL建表存储过程的VBA脚本^_^赞一下
2007-12-11 10:39
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 全局变量定义
Const MAX_COLUMN_NUM = 50
Dim stOutputPath As String
Dim stOutputFile As String
Dim stDBName As String
Dim stUserName As String
Dim stUserPasswd As ......