Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6993457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:46:02+00:00 2026-05-27T19:46:02+00:00

I have completely same defined 2 tables : t2 and t1. t2 has 1000

  • 0

I have completely same defined 2 tables : t2 and t1.

t2 has 1000 rows and t1 is totally empty.

How can I SELECT top 500 rows from t2 and INSERT them to t1?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T19:46:03+00:00Added an answer on May 27, 2026 at 7:46 pm

    I’ll use “emptyTable” and “populatedTable” because the questions is confusing

    Important TOP without an ORDER BY gives 500 arbitrary rows. There is never an implied or natural order to a table

    INSERT INTO emptyTable
    SELECT TOP 500 * 
    FROM populatedTable
    ORDER BY What -- need this to define TOP 500
    

    The lack of column list here is usually defined as bad practice but works only if

    • the tables are identical
    • there is no IDENTITY column in emptyTable

    Edit:

    ORDER BY is required to guarantee row order. See these. It’s also in the ANSI standard

    • http://sqlblog.com/blogs/alexander_kuznetsov/archive/2009/05/20/without-order-by-there-is-no-default-sort-order.aspx
    • http://blogs.msdn.com/b/conor_cunningham_msft/archive/2008/08/27/no-seatbelt-expecting-order-without-order-by.aspx
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My application has several independent top-level windows, which all have completely different functions/workflows. I
I have a couple old services that I want to completely uninstall. How can
I have two transactions managers defined in applicationContext, referencing two completely different sessionFactories. I
Note I have completely re-written my original post to better explain the issue I
I have two completely different forms in one template. How to process them in
Ive been smashing my head with this for a while. I have 2 completely
For doing builds, packaging files up, etc, it's needed to have a completely clean
I must have overlooked something completely obvious?? but my button displays its image and
I have an update program that is completely independent of my main application. I
I am completely confused - I have a website that renders perfectly in IE8

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.