Using Sql Server 7 Web Assistant to Improve performance of Asp Pages, Part 2By Venkatraman Ambethkar
In Part 1 we looked at running the SQL Server 7
Web Assistant Wizard to create an HTML file with the database information,
In this part we'll examine how to display this HTML file in the combo box on our ASP page!
Step3: Including the generated html in our ASP files wherever necessary
Start by opening your HTML editor and creating a new ASP page. We want to use a server-side include to import the contents of
<!-include file="output.html"--> to the file.
Now save this file as
Display.asp in your virtual directory. The code for this
sample file could be as follows.
(To learn more about server-side includes be sure to read: The
Now, request the
Display.asp from your browser, you should get the drop down box!
You can insert, update or delete a row in the jobs table and refresh the browser,
you will get the drop down duly updated. Neat, eh?
As you can see, the coding that we have done is only for the
which can also be used
for several other jobs which produce drop down boxes from other tables.
The rest of the work is only selecting things in the wizard. Even for creating the stored procedure
sp_makewebtask) which does all the work, we can use the wizard and use the code generated by the wizard.
Comparison of Performance Test
In order to give you a clear picture of the advantages of using HTML files over asp pages with database connection, I wrote another asp file which does exactly the same but using ADO Recordset whose code is as given below,
and carried out tests using Microsoft-Web Application stress Tool on both these files. Here is the tally.
|Test Criteria||With include file||With Database Connection|
|Threads = Stress Level * Stress Multiplier||100 = 10*10||100 = 10*10|
|Duration Of Test||1 min||1 min|
|Number of Hits||12,981||2,382|
|Requests Per Second||216.01||39.65|
|TTFB (Total Time for First Byte) in sec||0.451 secs||2.252 secs|
|TTLB (Total Time for Last Byte) in secs||0.455.79 secs||2.455 secs|
From the TTFB values, you can see how faster the file with include is.