04 2011 档案
摘要:返回一个10-1000的随机数:declare @M int,@N intset @N=10set @M=1000declare @t int declare @i intset @i=0while(@i<10000)begin select @t=cast((rand()*(@M-@N+1)+@N) as int) if(@t=10) begin select @t end set @i=@i+1end返回一个10-999的随机数: declare @M int,@N intset @N=10set @M=1000declare @t int declare @i intset @i=
阅读全文
摘要:--proc_insert 'pet_acation',1 /* 根据网上资料修改,完成于 2006-6-26 增加对自增列的支持 */ alter proc proc_insert ( @tablename varchar(256), @keepidentity tinyint =1,-- 是否保留identity原值 1:保留 0:不保留 @where varchar(1000)) as begin set nocount on declare @sqlstr varchar(8000) declare @sqlstr1 varchar(8000) declare @sql
阅读全文
摘要:--用户投注表历史表create table t_Userinfo_his ( rid int identity, userid int not null, --用户ID nick varchar(50) not null, --用户昵称 termid int not null, --比赛ID nums int not null, --投注数字 instone bigint not null, --投入金额 outstone bigint not null, --返还金额 addtime datetime not null, --投注时间 )go--功能:统计每日盈利最多的用户--...
阅读全文
摘要:public class DataHelper { const string DEFSTR = ""; /// <summary> /// 根据一个类型,获取其默认值,数字默认是为0,字符串默认值为一个空字符串 /// </summary> /// <typeparam name="T"></typeparam> /// <returns></returns> static T GetDefault<T>() { T t = default(T); //如果是字符串类型,
阅读全文
摘要:假如在D:\Java存放了两个java源文件:MyJava.java,Fighting.javaMyJava.java如下:public class MyJava {publicstatic void main(String[] arr){System.out.println("MyJava");}}Fighting.java如下:package mxw.ly;public class Fighting {publicstatic void main(String[] arr){System.out.println("学会使用java和javac命令")
阅读全文
摘要:1. 在存储过程开始时 set noucount on 结束时 set noucount off(设置nocount 为 ON 以后,只对当前链接一直有效(除非 set nocount off),对其他SQL会话无效)2.SET XACT_ABORT ON ,当 SET XACT_ABORT 为 ON 时,如果 Transact-SQL 语句产生运行时错误,整个事务将终止并回滚。为 OFF 时,只回滚产生错误的 Transact-SQL 语句,而事务将继续进行处理。编译错误(如语法错误)不受 SET XACT_ABORT 的影响。(设置XACT_ABORT 为 ON 以后,只对当前链接一直有效
阅读全文
浙公网安备 33010602011771号