读书人

sql 随机抽取数据解决思路

发布时间: 2012-03-20 14:01:10 作者: rapoo

sql 随机抽取数据
查了好多资料,都是newid()。可是newid()太慢了,需要等好几分钟

[解决办法]

C# code
  private static int GetNewSeed()        {            byte[] rndBytes = new byte[4];            RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider();            rng.GetBytes(rndBytes);            return BitConverter.ToInt32(rndBytes, 0);        } 

读书人网 >asp.net

热点推荐