ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
   
 
Categories  >>  Software  >>  Databases  >>  SQL Server
 
 


 

 
 Oracle interview questions  Oracle Interview Questions
 SQL Server interview questions  SQL Server Interview Questions
 MS Access interview questions  MS Access Interview Questions
 MySQL interview questions  MySQL Interview Questions
 Postgre interview questions  Postgre Interview Questions
 Sybase interview questions  Sybase Interview Questions
 DB Architecture interview questions  DB Architecture Interview Questions
 DB Administration interview questions  DB Administration Interview Questions
 DB Development interview questions  DB Development Interview Questions
 SQL PLSQL interview questions  SQL PLSQL Interview Questions
 Databases AllOther interview questions  Databases AllOther Interview Questions
Question
	

how to insert the values in 5 table at a time Using any
single statement ? 
 Question Submitted By :: Vivek
I also faced this Question!!     Rank Answer Posted By  
 
  Re: how to insert the values in 5 table at a time Using any single statement ?
Answer
# 1
By Usngle statementing procedure we have to insert in a si 
Is This Answer Correct ?    14 Yes 3 No
Gvg
 
  Re: how to insert the values in 5 table at a time Using any single statement ?
Answer
# 2
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
Sitakanta Rath
 
 
 
  Re: how to insert the values in 5 table at a time Using any single statement ?
Answer
# 3
use of the tigger 
Is This Answer Correct ?    3 Yes 2 No
Bintesh
 
  Re: how to insert the values in 5 table at a time Using any single statement ?
Answer
# 4
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 ?    15 Yes 1 No
Vishnu
 
  Re: how to insert the values in 5 table at a time Using any single statement ?
Answer
# 5
d 
Is This Answer Correct ?    0 Yes 7 No
D
 
  Re: how to insert the values in 5 table at a time Using any single statement ?
Answer
# 6
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
Pradeep Kumar
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
What is Cross Join  3
What does the INSTEAD OF trigger do?  3
select the 3rd maximum salary from sql server database if 4 (just an example In practically I may not know the exact situation) of the highest salaries are equal. TCS8
What meant by Performance Tuning,how can we do the performance tuning on stored procedures and tell some steps to do the performance tuning TCS3
system date format is "yy-mm-dd" "select getdate()" ----> 2009-01-24 20:03:28.513 if i write "select dateadd(dd,2,getdate()) ".it returns "2009-01-26 19:59:38.340"...my question is dat could it be possible to retrive da date in da format "26 jan 2009 ...."??  8
What is deadlock and how to avoid the deadlocks. Wipro3
I have a website that allows customers to browse and place orders for certain products. I have 2 tables; Customers and Orders. The Customers table holds the customer records and the Orders table holds the orders placed by the customer. Both tables are tied based on the field Cust_ID. Example of the data is shown below: Cust_ID Cust_Name Cust_ID Product Amount Order_Date 1001 John Tan 1001 P-5211 $120.00 2/13/2006 1002 Michael Wong 1001 K-1428 $88.90 1/11/2006 1003 Mary Cheong 1003 C-0923 $82.50 1/27/2006 1004 Ahmad Suffian 1003 K-1428 $88.90 2/2/2006 Write a single SQL statement that extracts all purchase records with the following criteria: 1. Customer names starting with “M” only. 2. Orders placed within the current month only. 3. Amount does not exceed $100.00 The list must be sorted by order date with the latest order showing on top. Techno-Solutions3
i want to create procedure for create table in sql server 2005 for example create procedure create_table @table varchar(20) as create @table( id int, name char(20) ) but it will get error what is solution? Aptech5
What is a table called, if it does not have neither Cluster nor Non-cluster Index?  2
How to find 6th highest salary from Employee table ?  7
what is call by value & call by reference ? Cap-Gemini2
1.can we set the more than 1 primary keys for a table? 2.please give me the difference between Cluster Index and non-Clustered Index 3.can we use query like this "Select * from Table1,Table2;"  7
 
For more SQL Server Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2012  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com