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
相关文档:
在入门篇,我们学会了SQL注入的判断方法,但真正要拿到网站的保密内容,是远远不够的。接下来,我们就继续学习如何从数据库中获取想要获得的内容,首先,我们先看看SQL注入的一般步骤:
第一节、SQL注入的一般步骤
首先,判断环境,寻找注入点,判断数据库类型,这在入门篇已经讲过了。
其次,根据注入 ......
1.DATEADD函数
在向指定日期加上一段时间的基础上,返回新的 datetime 值。
语法
DATEADD ( datepart , number, date )
参数
datepart
日期部分
缩写
Year
yy, yyyy
quarter
qq, q
Month
mm, m
dayofyear
dy, y
Day
dd, d
Week
wk, ww
Hour
hh
minute
mi, n
second
ss, s
millisecond
m ......
[code]declare @startdt datetime
declare @enddt datetime
select @startdt='2009-12-03',@enddt='2009-12-05'
select * from tb
where 开始日期 between @startdt and @enddt
or 结束日期 between @startdt and @enddt
or @startdt between 开始日期 and 结束日期
or @enddt between 开始日期 and ......
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 ......