Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...




how to insert the values in 5 table at a time Using any
single statement ?

Answers were Sorted based on User's Feedback



how to insert the values in 5 table at a time Using any single statement ? ..

Answer / vishnu

It is not possible to insert multiple rows with a single
insert statement. If you want to insert multiple rows, one
have to write multiple insert statements considering that
you are working SQL server 2005 or it's below version.

But SQL Server 2008 allows to insert multiple rows with a
single insert statement.

As for example,
In sql server 2005, if we need to insert multiple row, we
used to do something like this.
CREATE TABLE [State] (
[StateID] int,
[StateName] VARCHAR(20)
)
GO

INSERT INTO State
VALUES (1, 'Gujarat')

INSERT INTO State
VALUES (2, 'Dehli')

INSERT INTO State
VALUES (3, 'Bihar')

But with SQL Server 2008 we can combine all the three insert
statement in single insert statement. See below:
CREATE TABLE [State] (
[StateID] int,
[StateName] VARCHAR(20)
)
GO

INSERT INTO State
VALUES (1, 'Gujarat'),
(2, 'Dehli'),
(3, 'Bihar')

Hope this helps...

Is This Answer Correct ?    17 Yes 1 No

how to insert the values in 5 table at a time Using any single statement ? ..

Answer / sitakanta rath

Sql Server does not support this. In sql server 2000 n 2005
we cant insert values in multiple tables at a single time.

Is This Answer Correct ?    13 Yes 1 No

how to insert the values in 5 table at a time Using any single statement ? ..

Answer / gvg

By Usngle statementing procedure we have to insert in a si

Is This Answer Correct ?    14 Yes 3 No

how to insert the values in 5 table at a time Using any single statement ? ..

Answer / pradeep kumar

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

Is This Answer Correct ?    7 Yes 2 No

how to insert the values in 5 table at a time Using any single statement ? ..

Answer / bintesh

use of the tigger

Is This Answer Correct ?    3 Yes 2 No

how to insert the values in 5 table at a time Using any single statement ? ..

Answer / d

d

Is This Answer Correct ?    0 Yes 7 No

Post New Answer

More SQL Server Interview Questions

What are the recovery models in sql server 2000?

0 Answers  


Explain primary key in sql server?

0 Answers  


last function used in MS Access to convert sql what function will use in sql

0 Answers   Cap Gemini,


If you are working on a SQL database and if suddenly a developer changes the code and your queries results start giving errors,how will you check using a T-SQL query (on system tables) that what has changed in the database.

2 Answers   Microsoft,


What is model database? : SQL Server Architecture

0 Answers  


What happens if null values are involved in boolean operations?

0 Answers  


optimization techinques

0 Answers   Wipro,


what are user defined datatypes? : Sql server database administration

0 Answers  


how to trace the traffic hitting a sql server? : Sql server database administration

0 Answers  


Which index created when Create Index on table(col), Why

2 Answers   CGI,


What are partitioned views?

0 Answers  


Mention the 3 ways to get a count of the number of records in a table.

0 Answers  


Categories