2010年5月25日
摘要: 返回值只能是int,默认返回0.输入参数(默认) input输出参数 output 阅读全文
posted @ 2010-05-25 16:13 H&M 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 1、标量值函数  1)、创建create function fun_max(@x int, @y int)--标量函数returns int asbeginif @x<@yset @x = @yreturn @xenddeclare @x int, @y intset @x=1set @y=2print 'max= ' +cast(dbo.fun_max(@x,@y) as char)  c... 阅读全文
posted @ 2010-05-25 14:55 H&M 阅读(437) 评论(0) 推荐(0) 编辑
摘要: 1、错误信息及存储 1)、错误号   2)、错误信息   3)、错误的严重级别   4)、错误的状态级别   5)、发生错误的存储过程或触发器   6)、错误的语句代码行号  所有错误都存储在系统表master.dob.sysmessages中,可以使用raiserror语句将这些用户定义的错误返回到一个应用程序。2、错误捕获方法  1)、@@error    此技术简单但不总是可靠。if @@e... 阅读全文
posted @ 2010-05-25 10:57 H&M 阅读(786) 评论(0) 推荐(0) 编辑