khadem1386 Posted November 16, 2008 Share Posted November 16, 2008 HiThis code is very slower than access and I 'm wonder why!I 'm new in MS SQL 2005.This table have about 42,000 recodes and 2 fields (nchar(2) , int) where is problem? <!--- #include file="path.asp" --><%Server.ScriptTimeout=200%><%strSQLServerName = "xxxx.xxxxx.com"strSQLDBUserName = "xxxxx_xxxxx"strSQLDBPassword = "xxxxxxx" ' xxxxstrSQLDBName = "xxxxxxx_xxxxx" '"BANK_NAME"'MS SQL Server OLE DriverstrCon = "Provider=SQLOLEDB;Server=" & strSQLServerName & ";User ID=" & strSQLDBUserName & ";Password=" & strSQLDBPassword & ";Database=" & strSQLDBName & ";"Set sqlCon = Server.CreateObject("ADODB.Connection")sqlCon.connectionstring = strConsqlCon.Openset REstateZipcode = Server.CreateObject("ADODB.Recordset") REstateZipcode.Open "Select * from zipcode order by state" , sqlCon ,3,3 REstateZipcode.MoveFirstwhile Not REstateZipcode.EOF %> <% = REstateZipcode("State") %>____ <% = REstateZipcode("ZipcodeID") %> <BR><%REstateZipcode.MoveNextwendREstateZipcode.close sqlCon.close %> when this code run it hang about 50 seconds then start to write and transfer date to client. but if use this code by access it run and start write date immediately. Thanks for any help Link to comment Share on other sites More sharing options...
amj Posted November 17, 2008 Share Posted November 17, 2008 It would probably speed it up if the SQL code was changed to remove the *Select State, ZipcodeID from zipcode order by state Link to comment Share on other sites More sharing options...
khadem1386 Posted November 17, 2008 Author Share Posted November 17, 2008 thank for you.I change it but speed is as same when I run my page, it makes a 30 second delay and then start to fillThis is my address for test : (please use refresh button again) My test sqlIt has about 42,000 records but I read and know "that Sql solve MILLION * MILLION"Thank a lot Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.