Avatar of Amour22015
Amour22015
 asked on

TSQL - What is faster

Hi Experts,


This is more of an informational question

I have a co-worker that said that I should not:
Right click a table and take the option of: "Select top 1000 rows"
that it take more time to do this.

The co-worker said that it is best to:
just do new query and then type in your select statement.

But one would have to know all the columns in the select statement to do this?

So what approach is best?

Thanks for helping.
Microsoft SQL ServerMicrosoft SQL Server 2008SQL

Avatar of undefined
Last Comment
Amour22015

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
dsacker

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Vitor Montalvão

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Amour22015

ASKER
But that would run all rows and might take awhile?

maybe Select top 1000 *  From table?

So doing just the select statement is faster?

Thanks
Vitor Montalvão

Is not even a speed matter. Do you really want to return all rows or only the first 1000?
If you want all rows then TOP 1000 can't be a solution for you.
Amour22015

ASKER
Ok so just the select command is faster, thanks
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck