GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Tech FAQs  >  SQL Server
Go To First  |  Previous Question  |  Next Question 
 SQL Server  |  Question 63 of 71    Print  
Insert Data in Multiple Tables
How to insert data in multiple tables at same time. using SQL Server 2000


  
Total Answers and Comments: 2 Last Update: February 25, 2009     Asked by: rahulchd3112 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: swathi660
 
insert into t1 values(,,,) insert into t2 values(,,,) insert into t3 values(,,,,)......try this ........

Above answer was rated as good by the following members:
pankajalld06
January 15, 2009 07:12:36   
swathi660 Member Since: August 2008   Contribution: 2    

RE: Insert Data in Multiple Tables
insert into t1 values( ) insert into t2 values( ) insert into t3 values( )......try this ........
 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 1Overall Rating: -N/A-    
February 24, 2009 13:12:13   
krishna8081 Member Since: February 2009   Contribution: 2    

RE: Insert Data in Multiple Tables

Here is the example for you question.



USE
YourDB

GO

INSERT INTO
MyTable
(FirstCol
SecondCol)

SELECT First
1

UNION ALL

SELECT Second
2

UNION ALL

SELECT Third
3

UNION ALL

SELECT Fourth
4

UNION ALL

SELECT Fifth
5

GO



 
Is this answer useful? Yes | NoAnswer is useful 0   Answer is not useful 1Overall Rating: -1    

 Related Questions

Latest Answer : Data objects are basic runtime entities. ...


Latest Answer : Just replace "[your-schema-name-here]" in the following query with your schema name. Hope it comes handy to some of you out there. Select OBJECT_TYPE,OBJECT_NAME FROM(Select 'TABLE' as OBJECT_TYPE, TABLE_NAME as OBJECT_NAME, TABLE_SCHEMA ...
Read Answers (12) | Asked by :

Latest Answer : We can copy the Table structure also from one table to another tableExample:                   CREATE table emp1 as                    ...
Read Answers (3) | Asked by : penchal

Latest Answer : select * into new table name from old table name where 1=0 ...
Read Answers (2) | Asked by : mvkrishna

It's working in MySQL but not in SQL-Server. 
Latest Answer : Use a procedure which will delete record from child table first and then it will delete the same record from parent tableSame thing can be achieved using cascade delete and cascade update, this feature was not there in sql server 7.0 ...
Read Answers (3) | Asked by : kathir

How to display list of tables from a particular database in MS-SQLHow to display description of that particular table? 
Latest Answer : To Display list of tables in the database:SELECT * FROM INFROMATION_SCHEMA.TABLES WHERE TYPE='basetable'To describe the structure of a particular tableSP_HELP table_name; ...

How to deny insert, update, delete, update permissions for a specific user of a specific user database? 
Latest Answer : So what context is the user in?  A role a datareader? Datawriter?You want no permissions?USE Drop USER  In a role?EXEC sp_droprolemember 'rolename' , 'Member'single objects?Revoke SELECT, ...
Read Answers (1) | Asked by : rsurya

How to join same fields of four tables at SQL Server? 
Latest Answer : There are 5 types of join in sqlservercross joininner joinleft outer joinright outer joinfull outer joincross joinselect * from table1cross join table2cross join table3cross join table4inner joinselect * from table1 inner join table2on table1 .c1=table2.c1 ...
Read Answers (1) | Asked by : kadhar

How to transfer data from a text file to SQL table, Which is the best method to do that? 
Latest Answer : By using OPENROWSET commandExample:                   INSERT INTO dbo.ImportTestSELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=C:ImportData.xls', ...
Read Answers (1) | Asked by : Veeramma


 Sponsored Links

 
Related Articles

Breaking up XML into Relational Data

Breaking up XML into Relational Data While the preceding example shows how to construct an XML representation over relational data the example in this section illustrates how you can shred XML data back into relational data This reverse operation can be useful if your application works with relation
 

Querying Data with Oracle XQuery

Querying Data with Oracle XQuery Starting with Oracle Database 10g Release 2 you can take advantage of a full featured native XQuery engine integrated with the database With Oracle XQuery you can accomplish various tasks involved in developing PHP Oracle XML applications operating on any kind of dat
 

Retrieving XML Data

Retrieving XML DataTo retrieve XML data from an XMLType table you can use a SELECT SQL statement just as you would if you had to query a relational table For example to select the employee with the id set to 100 from the employees XMLType table discussed in the preceding section you might issue the
 

Using XMLType for Handling XML Data in the Database

Using XMLType for Handling XML Data in the Database Being an object type XMLType can not only be used to store XML data in the database but also to operate on that data via its built in methods Regardless of the storage model you choose XMLType provides a set of XML specific methods to operate on XM
 

Using Oracle Database for Storing, Modifying, and Retrieving XML Data

Using Oracle Database for Storing Modifying and Retrieving XML Data With Oracle XML DB you have various XML storage and XML processing options allowing you to achieve the required level of performance and scalability One of the most interesting things about Oracle XML DB is that it allows you to per
 

ODP.NET - Techniques to Improve Performance while Retrieving Data

ODP NET Techniques to Improve Performance while Retrieving Data Performance tuning is a great subject in Oracle Volumes of books would not be enough to cover every aspect of performance tuning in Oracle However in this section we will only discuss the fundamental performance techniques while working
 

ODP.NET - Populating a Dataset with a Single Data Table

ODP NET Populating a Dataset with a Single Data Table A dataset is simply a group of data tables These data tables can be identified with their own unique names within a dataset You can also add relations between data tables available in a dataset mosgoogle The following code gives you the details o
 

ODP.NET - Retrieving Typed Data

ODP NET Retrieving Typed Data While retrieving values from OracleDataReader we can extract information available in individual columns of a particular row either by using column ordinal position values or column names mosgoogle Retrieving Typed Data Using Ordinals ODP NET provides data specific enum
 

ODP.NET - Retrieving Multiple Rows on to the Grid

ODP NET Retrieving Multiple Rows on to the Grid In the previous section we tried to retrieve only one row using OracleDataReader In this section we will try to retrieve more than one row or a result set and populate a DataGridView on a WinForm mosgoogle The following code lists out the details of al
 

ODP.NET - Retrieving Data Using OracleDataReader

ODP NET Retrieving Data Using OracleDataReader OracleDataReader is simply a read only and forward only result set It works only if the database connection is open and it makes sure that the connection is open while you are retrieving data As the data that it retrieves is read only it is a bit faster
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2010 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape