SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Split by a row (count) number of a query results

By Bernabe Diaz, 2009/05/22

Total article views: 967 | Views in the last 30 days: 21

Sometime you need to split the query results row in a raw way, for example split the query results in bundles of 65000 rows.
In this utitlitary script is showed a way to do it.

We first create a temporary table to hold the query result, the table has an identity column that we will use to tract the spliting counting; the rest of the columns have to match the structure of the query result.

We create a loop based on the bundle size required.

Try it.

By Bernabe Diaz, 2009/05/22

Total article views: 967 | Views in the last 30 days: 21
Your response
 
 
Related Articles
FORUM

Copy query result issue

Copy query result issue

FORUM

Problem with query result

Query result out of......

FORUM

Two query results mixed together

Two query results mixed together

FORUM

multi queries result to different excel sheets

multi queries result to different excel sheets

FORUM

Merging 3 query results

Merging result sets which is a result of the execution of 3 queries

Tags
t-sql    
 
Contribute

Free registration required...

To read the rest of this article, and access thousands of other articles, we ask you to register on the site and subscribe to our newsletters.

Login (existing users)

Login

Email:   Password:   Remember me: Forgotten your password?

Register (new users)

Register

Email:   Password:
Confirm:

Subscribing to our newsletters gets you:

  • ALL of our content (thousands of articles, scripts, and forum postings)
  • A daily newsletter (example)
  • A weekly news round up (example)
  • The opportunity to ask and answer questions in our forums
  • A daily Question of the Day to test and help you increase your knowledge of SQL Server.

Steve Jones
Editor, SQLServerCentral.com