博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

MS SQL Server2000 学习记录

Posted on 2008-04-09 15:05  james.dong  阅读(374)  评论(0编辑  收藏  举报

 

(1) MS SQL Server 无法启动故障解决 

操作系统:WinXP(English)

版本:MS SQL Server 2000

故障:Administator用户安装SQL Server后对Administator修改了密码,导致SQL Server无法正常启动,报错“An error 1069 - (The service did not start due to a logon failure) occurred while performing this service operation on the MSSQLServer service.”

解决:打开“start->>Control Panel->>Administrative Tools->>Services”,找到MSSQLSERVER服务,点击右键选择“properties”,选择“Log On”选项卡,修改相应密码即可。如果Administator的密码需要经常改动,建议选择“Local System account”使用本地账户启动。

 

(2)关于触发器停止和启动的问题

  --禁止打开表中的所有触发器:  
  --alter table 表A disable trigger all  
  --重新打开表中的所有触发器:  
  --alter table 表A enable trigger all  
禁用的时候,是对所有用户生效的.

(3)保留数值的2位小数点的处理

    select cast( 12.345 as decimal( 8 , 2 ) ) 

   --12.34

 (4) 四舍五入处理

  select round( 12.345 , 2 ) 

  --12.350

  select round( 12.12 , 5 )

  -- 12.12

(5) 对数值先  四舍五入 再 保留数值的2位小数点的处理

    select  cast ( round( 12.345 , 2 ) as decimal( 8 , 2 ) )

   -- 12.35