eBusiness Help
Reach Millions of Job Seekers
Post a job now and save $50.
500 FREE web conferencing minutes in January.
Get A FULL RANGE of Advanced Features to Enhance Your Meetings.

WebProWorld Dev Forum

Web Position Gold
Have for a while now owned a copy of Web Position Gold but never got round to testing it out. Would be interested in hearing comments on its usefulnes. It seemed a litle complicated on both times I took time to look at it.
Click to read more...

Thunderbird 1.0
Mozilla released Thunderbird 1.0. I was using 0.8 and upgraded today. So far I haven't found any of the new features to be anything I'll likely be using, but I think some people will find them handy.
Click to read more...

Blocking websites witout a server
I've been working at a high school and we're dealing with a problem. Our students are spending important time playing online games and using AIM through the web. We'd like to block certain sites, but we do not have a server. Does anyone have any suggestions on blocking certain websites? Any and all help would be appreciated.
Click to read more...


Recent Articles

SQL Server Configuration Performance Checklist
Most SQL Server Configuration Settings Should Not Be Changed. In this article, we are going to take a look at some of the performance-related SQL Server configuration settings. These are SQL Server-specific settings that can be modified using either Enterprise Manager or SP_CONFIGURE.

SQL Server Hardware Performance Checklist
Auditing SQL Server Hardware Is An Important Early Step. From this previous article, on using Performance Monitor, you may have identified some potential hardware bottlenecks that are negatively affecting your SQL Server's performance.

Embedded Databases
An Embedded database is a specific database genus that does not run as a separate process, instead, it is directly linked ("embedded") into the application. Herein, the database is integrated into the application and the end-user has little or no knowledge that the database exists.

The Best Day Ever to Design a Database Structure
Have you ever been faced with the challenge of designing a new database structure? Do you have to redevelop an existing database?

Using Performance Monitor to Identify SQL Server Hardware Bottlenecks
The best place to start your SQL Server performance audit is to begin with the Performance Monitor (System Monitor). By monitoring a few key counters over a 24 hour period, you should get a pretty good feel for any major hardware bottlenecks your SQL Server is experiencing.

Backing Up And Restoring Your MySQL Database
If you've been using MySQL database to store your important data, it is imperative that you make a backup of your data to prevent any loss of data. This article shows you how to backup and restore data in your MySQL database.

01.07.05


SQL Server Application And Transact-SQL Performance

By Brad M. McGehee

Application and Transact-SQL Code Greatly Affect SQL Server Performance.

Of all the areas that can negatively affect the performance of SQL Server, the application code used to access SQL Server data, including Transact-SQL code, has the biggest potential of hurting performance. Unfortunately though, this is an area that a lot of DBAs don't directly control. And because of this, this area if often neglected when performance tuning SQL Server-based application.

As with previous articles in this series, the purpose of this part of the audit is to catch the "easy" performance-related issues of your application and Transact-SQL code that accesses SQL Server data. Besides the tips listed here, there are a lot more factors that affect SQL Server's performance, but the ones listed here are a good beginning.

Of course, if you are using third-party software, then this part of the performance audit doesn't affect you as you can't do much about the code. But if you have developed your own applications, or if the applications have been developed in-house, then you should be able to take part in this portion of the SQL Server performance audit.

As you review the audit items, and their discussion below, you will quickly discover that identifying some of these issues, or even fixing them, is no small task. Because of this, it is much better to build your applications with these performance tips in mind instead of having to fix them after the application has been written. You may want keep this article around when building new applications so that you build them for performance the first time around.

Transact-SQL Checklist

Does the Transact-SQL Code Return More Data Than Needed?


The less data returned by SQL Server, the less resources SQL Server needs to operate, helping to boost the overall performance of SQL Server. This may sound obvious, but returning unnecessary data is a performance problem that I see over and over.

Here are some of the most common mistakes made by coders when returning data from SQL Server that results in more data than necessary:

  • The absence of a WHERE clause. Unless you want to return all data from a table, which is a rare activity, the use of a WHERE clause is necessary to reduce the number of rows returned.

  • As an adjunct to the above advice, a WHERE clause needs to be a selective as possible. For example, if you only need to return records from a particular date, don't return all the records for the month, or year. Design the WHERE clause so that exactly only those rows you need returned are returned, and not one extra row.

    Reach Millions of Job Seekers
    Post a job now and save $50.

  • In the SELECT clause, only include those columns that you need, not all of them. Along the same line, don't use SELECT *, as you will most likely be returning more rows that you need.

  • I will refer to this one again later on this page, but it also applies here. Don't perform SELECTs against views, instead, bypass the view and get the data you need directly from the table. The reason for this is that many views (of course, not all) return more data than is necessary for the calling SELECT statement, which just ends up returning much more data than necessary.

    In case you are not aware of them, here are some of the performance issues caused by returning unnecessary data: Sometimes, returning too much data forces the Query Optimizer to perform a table scan instead of an index lookup; extra I/O is needed to read data; buffer cache space is wasted, which could be better used by SQL Server for other purposes; unnecessary network traffic occurs; on the client, additional data has to be stored in memory which might be better used for other uses; and so on.

    Are Cursors Being Used When They Don't Need to Be?

    Cursors of any kind slow SQL Server's performance. While is some cases they cannot be avoided, in many cases they can. So if your application is currently using Transact-SQL cursors, see if the code can be rewritten to avoid them.

    If you need to perform row-by-row operations, consider using one or more of these options instead of using a cursor:

  • Use temp tables

  • Use WHILE loops

  • Use derived tables

  • Use correlated sub-queries

  • Use CASE statements

  • Use multiple queries

    Each of these above options can substitute for a cursor, and they all perform much faster.

    If you can't avoid using cursors, then at least try to speed them up. Find out how you can speed up cursors at this webpage.

    Read the Rest of the Article.

    *Originally published at SQL-Server-Performance.com


    About the Author:
    Brad M. McGehee is a full-time DBA with a large manufacturing company, and the publisher of http://www.SQL-Server-Performance.Com, a website specializing in SQL Server performance tuning and clustering.

    He is an MVP, MCSE+I, MCSD, and MCT (former).

  • About SQLproNews
    SQLproNews is a collection of up to date tutorials and insightful articles designed to help SQL users of any skill level implement successful SQL systems and practices. SQL Strategies and Tactics for Business

    SQLproNews is brought to you by:

    SecurityConfig.com NetworkingFiles.com
    NetworkNewz.com WebProASP.com
    DatabaseProNews.com SQLProNews.com
    ITcertificationNews.com SysAdminNews.com
    SQLproNews.com WirelessProNews.com
    CProgrammingTrends.com SysAdminNews.com


    -- SQLProNews is an iEntry, Inc. publication --
    iEntry, Inc. 880 Corporate Drive, Lexington, KY 40503
    2005 iEntry, Inc.  All Rights Reserved  Privacy Policy  Legal

    advertising info | news headlines | free newsletters | comments/feedback | submit article

    SQL Strategies and Tactics for Business SQLproNews News Archives About Us Feedback SQLproNews Home Page About Article Archive News Downloads WebProWorld Forums Jayde iEntry Advertise Contact