Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
| Search | Today's Posts | Mark Forums Read
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
  #1 (permalink)  
Old July 16th, 2003, 02:01 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: abu dbabi, , United Arab Emirates.
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default thousands records enter one table to another table

Hi,

thousands of records can enter (happend)from one table to another table's field ?
what query will use. by the help of loop etc.

table name contract,
field name contractno.
field type is numeric

regards.

Mateen Martin
mateenmohd@hotmail.com
  #2 (permalink)  
Old July 16th, 2003, 02:06 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Hudson, MA, USA.
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

I'm sorry.

I cannot parse your question. What do you want to do?

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com
  #3 (permalink)  
Old July 16th, 2003, 08:39 PM
uit uit is offline
Authorized User
 
Join Date: Jul 2003
Location: , , .
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default

First, with native SQL (like Query Analyzer) or within programming logic such as (ASP, VB, etc...) ?

If using Q.A., you might want to look into the
INSERT INTO <table1>
SELECT col1, col2, ... coln
FROM <table2>
WHERE <cond>

-and-

SELECT col1, col2, ... coln
INTO <table1>
FROM <table2>
WHERE <cond>

-or-

using a T-SQL batch with a CURSOR to loop through your input and dump it into a table.

-or-

DTS -or- BCP to load your table...


If using ASP or VB or some other language, you could use a loop like DO WHILE or DO UNTIL with INSERT statements, or you could use one of the above INSERT/FROM or SELECT/INTO statements, or some ADO cursor looping...

You werent too specific about your environment or needs but I suspect you might want to look at the INSERT/FROM and SELECT/INTO in Books Online AND, get yourself a copy of Wrox' SQL Server 2000 Programming - its gonna help you a lot.

Hope that helps....


  #4 (permalink)  
Old July 17th, 2003, 07:52 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: abu dbabi, , United Arab Emirates.
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks for response.
I am using asp.



Quote:
quote:Originally posted by uit
 First, with native SQL (like Query Analyzer) or within programming logic such as (ASP, VB, etc...) ?

If using Q.A., you might want to look into the
INSERT INTO <table1>
SELECT col1, col2, ... coln
FROM <table2>
WHERE <cond>

-and-

SELECT col1, col2, ... coln
INTO <table1>
FROM <table2>
WHERE <cond>

-or-

using a T-SQL batch with a CURSOR to loop through your input and dump it into a table.

-or-

DTS -or- BCP to load your table...


If using ASP or VB or some other language, you could use a loop like DO WHILE or DO UNTIL with INSERT statements, or you could use one of the above INSERT/FROM or SELECT/INTO statements, or some ADO cursor looping...

You werent too specific about your environment or needs but I suspect you might want to look at the INSERT/FROM and SELECT/INTO in Books Online AND, get yourself a copy of Wrox' SQL Server 2000 Programming - its gonna help you a lot.

Hope that helps....




Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert table records into another table. hewstone999 Access VBA 2 March 5th, 2008 11:01 AM
How to enter <...,1> values into table. RaCheer SQL Language 1 February 5th, 2006 11:59 PM
copy and append records from table-A to table B bhunter Access 6 March 9th, 2004 02:02 PM
Append Records From One Table to Another Table twsinc Access VBA 4 February 29th, 2004 03:04 PM
size of table (type table is table of number) MikoMax Oracle 1 November 19th, 2003 03:11 AM





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