MDB dosyasından rastgele veri çekebilirmiyim?
17
●1.696
- 20-04-2009, 02:07:39
<!-- #include virtual="/asp/public.asp" --> <% Dim StartTime StartTime = Timer dim SQLCount SetConnObject conn,rs '1. Yöntem sql = "SELECT rows AS TABLECOUNT FROM sysindexes WHERE id = OBJECT_ID('TABLENAME') AND indid < 2" rs.open sql,conn SQLCount = rs("TABLECOUNT") Response.Write ("Toplam Kayıt : " & SQLCount &"<br>") rs.close Randomize Timer intRnd = (Int(RND * SQLCount)) sql = "SELECT * FROM TABLENAME WHERE PK ="&intRnd rs.open sql,conn Response.Write("1. Yöntem" & Timer-StartTime &" saniye sürmüştür. Random ID" & rs("FIELDNAME") & "<BR>") rs.close '2. Yöntem StartTime = Timer sql="SELECT top 1 PK,FIELDNAME FROM TABLENAME ORDER BY RAND(PK), FIELDNAME" rs.open sql,conn Response.Write("2. Yöntem" & Timer-StartTime &" saniye sürmüştür. Random ID" & rs("FIELDNAME") & "<BR>") rs.close '3. Yötenm StartTime = Timer sql = "SELECT * FROM TABLENAME" rs.Open sql, conn,1,3 Randomize Timer intRnd = (Int(RND * rs.RecordCount)) rs.Move intRnd Response.Write("3. Yöntem" & Timer-StartTime &" saniye sürmüştür. Random ID" & rs("FIELDNAME") & "<BR>") rs.close FreeConnection conn,rs %>Buda bütün yollar ve bu sayfanın çalıştırılması sonucunda ise aşağıdaki sonuçlar görüntülendi.
Toplam Kayıt : 80575646
1. Yöntem 0.04 saniye sürmüştür. Random ID0011897281
2. Yöntem 19,26611 saniye sürmüştür. Random ID0011879701
3. Yöntem Timeout expired
- 20-04-2009, 02:08:49Rica ederimobidergi adlı üyeden alıntı: mesajı görüntüle
Bende hazır yapmışken bu testi sitemde uzun süredir bekleyen yazıyı bitireyim
- 20-04-2009, 03:06:12Yazdım. Bir hayli uzun ve başımı ağrıtan bir yazı oldu
Umarım okurken başınız ağrımaz 
Mssql’den Random Veri Seçme RaMaZaN
- 20-04-2009, 12:02:09SELECT TOP 1 PK,FIELDISMI1, FIELDISMI2 FROM TABLENAME ORDER BY RAND(PK)
şeklinde denermisin. Eğer datan fazla değilse. Akşam üzeri birlikte yapalım. - 20-04-2009, 16:31:45Üyeliği durdurulduInternal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator to inform of the time the error occurred and of anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
böle hata aldım