Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 14th, 2004, 03:29 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default Split Data into Multiple Tables

Hi Everyone,

I am looking to split a table in multiple tables. I have 29221283 records to split into 10 equals parts, like TableA, TableB, TableC, etc., does anyone have a script or a method to cycle through the records for selecting the split for the table.

These are the column names and data types

    ID int 4
    Xcoord float 8
    Ycoord float 8
    Elev float 8
Any help or recommendation will be greatly appreciated.


__________________
Jaime E. Maccou
 
Old June 14th, 2004, 03:39 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi,

You can try with SELECT INTO passing top XXXXX number of records and split them. It would not take too much time for that.

Or If you want I can write a script to do that for you.

Cheers!

_________________________
-Vijay G
Strive for Perfection
 
Old June 14th, 2004, 03:50 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

If it is not asking too much, I really appreciate the script.
 
Old June 14th, 2004, 04:10 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
quote:
I am looking to split a table in[to] multiple tables. I have 29221283 records to split into 10 equal parts...
On what basis would you split these? IOW, how would you know which data is in which table after the split has been done and you want to query the data?

And why do you want to split them? What's wrong with having them all in one table?

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com
 
Old June 14th, 2004, 05:10 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

I will like to split them by ID sequential

for example

TableA 1- 9000
TableB 90001- 20000 etc.,

The data will not change, these are GIS coordinates.

The database is in ACCESS 2000 and GIS users complain their searches are very slow. It will soon be moved to SQL 2000.

 
Old June 14th, 2004, 05:15 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

What version of Access is that? INT and FLOAT looks like SQL server datatypes, and not of ACCESS.

_________________________
-Vijay G
Strive for Perfection
 
Old June 14th, 2004, 05:20 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

These are SQL 2000 Data types. The Database is in Access 2000 at the moment.

 
Old June 14th, 2004, 05:24 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

So is that you want to split and port data from Access to SQL?

_________________________
-Vijay G
Strive for Perfection
 
Old June 14th, 2004, 05:24 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
quote:Originally posted by jemacc
 I will like to split them by ID sequential

for example

TableA 1- 9000
TableB 90001- 20000 etc.,

The data will not change, these are GIS coordinates.

The database is in ACCESS 2000 and GIS users complain their searches are very slow. It will soon be moved to SQL 2000.
Are you sure that the reason the query is slow is because the table is 'too' big? Just be sure you are solving the right problem, especially if you are moving to a real database...

How do you intend to do your lookups? What table will you use to look up a random set of coordinates, for example? I hope you never have to JOIN to these tables and combine coordinates, as figuring out which table contains which data is going to be a nightmare...

IMO, this is almost assuredly a bad idea...

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com
 
Old June 14th, 2004, 05:29 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

From My understanding (GIS Group) indicates their software knows how to handle this.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Command to insert data in multiple tables? dstein4d Access VBA 3 November 18th, 2008 09:16 AM
Inserting Data into Multiple Tables bfoley SQL Server ASP 1 January 3rd, 2008 12:28 AM
Inserting data in multiple tables rohits PHP How-To 1 August 29th, 2006 11:32 PM
data from multiple tables keyvanjan Classic ASP Basics 1 January 24th, 2006 06:32 PM
Importing Multiple files in Multiple tables Versi Suomi Access 6 June 1st, 2005 08:47 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.