sql 表修改列
create table #a
(
a int identity(1,1) primary key,
b int default(0) not null,
c nvarchar(20)
)
insert into #a(c)
select 'a' union all
select 'b' union all
select 'c' union all
select 'd' union all
select 'e'
select * from #a
alter table #a drop constraint DF__#a_____________b__1273C1CD
alter table #a add constraint DF__#a_____________b__1273C1CD default(1) for b
alter table #a add c nvarchar(10) not null constraint DF_#a_b default('aa')
--有约束的时候可以通过错误提示来查约束名
alter table 表名 drop column [列名]
alter table 表名 add [列名] [类型] NULL CONSTRAINT [DF_表名_列名] DEFAULT ((0))
select * from #a
相关文档:
---------数学函数
1.绝对值
S:select abs(-1) value
O:select abs(-1) value from dual
2.取整(大)
S:select ceiling(-1.001) value
O:select ceil(-1.001) value from dual
3.取整(小)
S:select floor(-1.001) value
O:select floor(-1.001) value from dual
4.取整(截取)
S:select cast ......
/*
select *,dbo.getDeptTree(id) as DeptTree from sysdept
递归函数
*/
CREATE function getDeptTree(@NodeId int)
returns varchar(8000)
as
begin
declare @ret varchar(8000),@ParentId int,@len int
set @len = 0
&nb ......
///<summary>
///备份数据库到本地磁盘
///</summary>
public bool BackUp(string BackUpFile)
{
try
&nbs ......
一、在Delphi7中连接MS SQL Server 2000的方法。
刚开始时界面如下:添加4个控件。
设置控件属性过程:
1、ADOConnection1设置
1)双击ADOConnection1,进行设置连接字符串(作用是:选取连接驱动方式和连接的数据库设置)。过程如下图所示:
2、ADOQuery1设置:
1)ADOQuery1.connection属性为ADOConnection1; ......