=================分页==========================
/*分页查找数据*/ |
=========================用户注册============================ /* 用户注册,也算是添加吧 */ Create proc [dbo].[UserAdd] ( @loginID nvarchar(50), --登录帐号 @password nvarchar(50), --密码 @email nvarchar(200) --电子信箱 ) as declare @userID int --用户编号 --登录账号已经被注册 if exists(select loginID from tableName where loginID = @loginID) begin return -1; end --邮箱已经被注册 else if exists(select email from tableName where email = @email) begin return -2; end --注册成功 else begin select @userID = isnull(max(userID),100000)+1 from tableName insert into tableName (userID,loginID,[password],userName,linkNum,address,email,createTime,status) values (@userID,@loginID,@password,'','','',@email,getdate(),1) return @userID end |
===================阿拉伯数字转大写中文============= 例:输入12345,程序给出:壹万贰仟叁佰肆拾伍 例:输入10023040,程序给出:壹仟另贰万叁仟另肆拾 解决方案之一(在SqlServer2000中测试通过): SELECT @i=0,@res=@temp%10,@temp=@temp/10 --测试:有0和没有0的情况 SELECT dbo.fun_cgnum(900000000),dbo.fun_cgnum(903002051),dbo.fun_cgnum(903002050) |