|
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
|
|
|
June 14th, 2004, 03:29 PM
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
June 14th, 2004, 03:39 PM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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
|
June 14th, 2004, 03:50 PM
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
If it is not asking too much, I really appreciate the script.
|
June 14th, 2004, 04:10 PM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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
|
June 14th, 2004, 05:10 PM
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
June 14th, 2004, 05:15 PM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
What version of Access is that? INT and FLOAT looks like SQL server datatypes, and not of ACCESS.
_________________________
-Vijay G
Strive for Perfection
|
June 14th, 2004, 05:20 PM
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
These are SQL 2000 Data types. The Database is in Access 2000 at the moment.
|
June 14th, 2004, 05:24 PM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
So is that you want to split and port data from Access to SQL?
_________________________
-Vijay G
Strive for Perfection
|
June 14th, 2004, 05:24 PM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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
|
June 14th, 2004, 05:29 PM
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
From My understanding (GIS Group) indicates their software knows how to handle this.
|
|
|