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 ?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the impact on other user sessions when creating indexes?

873


What is used to replicate sessions between instances in coldfusion clusters?

1016


What is sql server management studio? : sql server management studio

1014


how many bits ip address consist of? : Sql server database administration

847


what is blocking? : Sql server database administration

981


When would you use it?

943


What are the difficulties faced in cube development? : sql server analysis services, ssas

997


How to verify the port number of the sql server?

1038


what are different types of backups available in sql server? Given a particular scenario, how would you go about choosing a backup plan? : Sql server database administration

875


how to avoid cursors? : Sql server database administration

904


Why we use the openxml clause?

955


What is logon trigger?

1028


Does sql server 2000 full-text search support clustering?

814


How to write an inner join with the where clause in ms sql server?

1028


Tell me what is difference between view and materialized view?

882