用SQL语句得到SQLServer 的表中的列的描述值
select case when c.colid=1 then object_name(c.id) else '' end as 表名
,c.name as 字段名
,t.name 数据类型
,c.prec as 长度
,p.value as 描述信息
,m.text as 默认值
from syscolumns c
inner join systypes t on c.xusertype=t.xusertype
left join sysproperties p on c.id=p.id and c.colid = p.smallid
left join syscomments m on c.cdefault=m.id
where objectproperty(c.id,'IsUserTable')=1
相关文档:
sql编译与重编译
1.sp_recompile
使存储过程和触发器在下次运行时重新编译。
2.sp_refreshview
如果视图所依赖的基础对象发生更改(如:表增加了一个字段),则视图不会自动更新,这时需要调用该存储过程来对视图进行刷新。有人说,重新打开一下视图就可以更新视图,但我试了没有成功。
例1:刷新指定名称的视图
......
SQL Server 服务由于登录失败而无法启动
1.症状
在重新启动 SQL Server、SQL Executive 或 SQL Server Agent 时,可能无法启动该服务,并显示以下错误信息:
Error 1069:The service did not start due to a logon failure.
或者
错误 1069:由于登录失败而无法启动服务
2.原因
SQL Server、SQL Agent 或 SQL Serve ......
create table [表名]
(
[自动编号字段] int IDENTITY (1,1) PRIMARY KEY ,
[字段1] nVarChar(50) default '默认值' null ,
[字段2] ntext null ,
[字段3] datetime,
[字段4] money null ,
[字段5] int default 0,
[字段6] Decimal (12,4) default 0,
[字段7] image null ,
)
删除表:
Drop t ......
表:TABLEA
客户编号 应收金额 收款金额
1001 100 80
1001 200 180&nb ......