Home » ASP

ASP and SQL Server Optimizing Codes

5 June 2008

ASP as a common web scripting is usually combines with SQL Server database. For medium to big web applications, performance sometimes becomes a major problem.

You can optimize your codes by following knowledge base below.

FROM Clause

Always use [yourdatabase].[dbo].[yourtablename] format in the FROM clause of your SQL query.

SELECT *
FROM yourdbname.dbo.yourtablename

Using this format will save a few cycles in SQL Server processes. Putting table name directly in FROM clause will make SQL Server do searching in entire database objects first.

Stored Procedure

Avoid writing your long query in ASP files. Use Stored Procedure instead to increase application performance.

Meanwhile, although some people suggest not writing any SQL Query in ASP files, but I personally did that for simple or short query to easier codes maintenance.