Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sachinsamuel
Constraint Violating Yak Guru
383 Posts |
Posted - 2003-03-21 : 07:26:48
|
| Hi all,I have a small doubt. Which one of these two statement will be faster ?1) Select branch_id, branch_name from branch_details2) Select branch_id as b12, branch_name as b34 from branch_detailsAnd please explain why ?Thanx in advanceSachinsachin.samuel@fqsltd.com |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2003-03-21 : 07:27:45
|
| The difference should be un-measurable.Why?Jay White{0} |
 |
|
|
sachinsamuel
Constraint Violating Yak Guru
383 Posts |
Posted - 2003-03-21 : 07:42:38
|
| Hi Jay,Thanx for the prompt reply. I want to do this becuase I am creating an XML document and I want the tags should be user defined, or customised. So if I want to create a tag with name b12 inspite of branch_id, I can do that by giving an alias name to it. But the Only concern is, Will it affect the performance of the query?ThanxSachin |
 |
|
|
sachinsamuel
Constraint Violating Yak Guru
383 Posts |
Posted - 2003-03-21 : 08:08:08
|
| Please help me if anybody can.Thanx in advanceSachin |
 |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2003-03-21 : 08:12:23
|
quote: The difference should be un-measurable.
But don't take my word for it. Test it yourself. And please, let us know what your test results show.Jay White{0} |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2003-03-21 : 14:25:35
|
| I doubt that you will see any difference because the statements are equivalent. You're just telling it what to call the column. Aliasing the column will not affect performance. The difference will be un-measurable as Page47 said.Tara |
 |
|
|
|
|
|