i want to join two queries....and i want to run them as one
after another that is want output of first query then
second , then again output of first query then second and
so on...

Answers were Sorted based on User's Feedback



i want to join two queries....and i want to run them as one after another that is want output of f..

Answer / ashna thampi

declare @i int
set @i=1
while @i < 100
begin
if (@i)%2 =1
begin
select * from TABLE1
end
else
select * from TABLE2
set @i=@i + 1
end

Is This Answer Correct ?    4 Yes 1 No

i want to join two queries....and i want to run them as one after another that is want output of f..

Answer / vrinda

DECLARE @i int
SET @i=0
While @i<10
Begin
if @i%2=0
BEGIN
SELECT * FROM Table1
END
ELSE
BEGIN
SELECT * FROM Table2
END
END

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More SQL Server Interview Questions

Which table keeps information about stored procedures?

0 Answers  


Why SQL Agent is used?

0 Answers   Abacus,


What is one of the first things you would do to increase performance of a query? For example, a boss tells you that ?a query that ran yesterday took 30 seconds, but today it takes 6 minutes?

2 Answers   Accenture, Merrill Lynch, Wipro,


What are unicode character string data types in ms sql server?

0 Answers  


What is indexing in sql server with example?

0 Answers  






how we can count records as a group of days like sum of records for(four mondays),(four tuesday)........ in a month. group the column for weekdays.

1 Answers  


What is the purpose of floor function?

0 Answers  


What is a mixed extent?

0 Answers  


Can we update data in a view?

0 Answers  


1. Tell me your daily activities 2. If sql server installation fails at time installation what will do 3. Where does the sql server installation log details are stored 4. After the installation what will you do for memory configuration 5. What is the difference between SQL max maximum memory and AWE memory 6. How will you configure AWE memory 7. How will setup an email alert for the backup job 8. After the SQL installation what are the jobs will you configure 9. What does –g mean in the sql startup parameter 10. What is the difference between Bulked log and Full recovery model 11. What is the difference between mirroring and log shipping 12. What are the steps to be followed before in-place up gradation 13. After installing the patch the sql server does not start and application team tells to rollback the changes .In this scenario what will you do

0 Answers   CSC, IBM,


what is database replicaion? What are the different types of replication you can set up in sql server? : Sql server database administration

0 Answers  


What is the query optimization statistics?

1 Answers  


Categories