Who is online? 164 guests and 0 members
Member login | Become a member
Posted: 10/15/2009 2:44:39 PM
Hi,I have a table with name user,this table contains 5 columns.Now I want to select all these 5 columns,there is two ways to do this
1. Select * From User
2. Select [ColumnName1],[ColumnName2]....[ColumnName5] From User
Both Query Gives me the same results.Now my question is that in both the Queries which one is optimised query,and how we find out the optization of the queries
Posted: 10/15/2009 9:20:59 PM
I'm not a SQL expert but IMOH, If you are going to select certain columns in a Table then i would prefer Option 2. this would increase the performance of your query because you are only filtering the wanted columns in the table..
Here's a useful article that you can refer on : How To: Optimize SQL Queries
Posted: 2/18/2010 12:52:53 AM
Vijjendra said: 1. Select * From User2. Select [ColumnName1],[ColumnName2]....[ColumnName5] From UserBoth Query Gives me the same results.Now my question is that in both the Queries which one is optimised query,and how we find out the optization of the queries
You can run the sql profiler to check which query takes more time to run...
please visit this
http://searchsqlserver.techtarget.com/tip/0,289483,sid87_gci1171978,00.html
Posted: 2/18/2010 1:46:02 AM
Thanks yrbyogi and VinzI got my question's answer from the following link:http://stackoverflow.com/questions/321299/what-is-the-reason-not-to-use-select
Posted: 2/22/2010 4:35:20 AM
dear sir i go through the link which you had mationed in ur answer bt i am still in confusion
will you please make yhe point clera