Please give me the SP for the below scenario. I have two
tables named Table1 and Table2...I need to fetch record by
record from Table1 and insert the record in to table2 where
the value in the sno column of the table1 is even number.




Answers were Sorted based on User's Feedback



Please give me the SP for the below scenario. I have two tables named Table1 and Table2...I need to..

Answer / meenaprasanna

insert into table2(Column1,Column2) select Column1,Column2
from Table1 where Column1 %2 ='0'

Is This Answer Correct ?    14 Yes 2 No

Please give me the SP for the below scenario. I have two tables named Table1 and Table2...I need to..

Answer / mythili

insert into table2(Column1,Column2) select Column1,Column2
from Table1 where Column1 %2 ='0'

Is This Answer Correct ?    13 Yes 1 No

Please give me the SP for the below scenario. I have two tables named Table1 and Table2...I need to..

Answer / rajesh.a

insert into table2(Column1,Column2) select Column1,Column2
from Table1 where Column1%2 = 0

Is This Answer Correct ?    8 Yes 0 No




Please give me the SP for the below scenario. I have two tables named Table1 and Table2...I need to..

Answer / priyanka malondkar

First make a function like this
create function functionname(@sno int)
returns number;
declare check;
begin
check=@sno%2
if check=0
return 0;
else
return 1;


Then the query will be
declare no;
insert into Table2(a,b,c) values select (a,b,c) from Table1
where no=functionname(sno) and no=0;

Kindly check.
In case of any syntax error please excuse as i have not
checked it of sql sever.

Is This Answer Correct ?    5 Yes 1 No

Post New Answer



More SQL Server Interview Questions

How many nested transaction can possible in sql server?

3 Answers   Bank Of America,


how do we insert 100 records at a time in a table without using for loop in database

1 Answers  


what is meant by deafult in sql server?

2 Answers  


one table has four field id,name,design,salary. i have to find maximum salary .

6 Answers  


how to implement locking in sql server

3 Answers   Satyam,






What is the Main Difference between ACCESS and SQL SERVER?

0 Answers   MindCracker,


Hi, I have a table A which has four rows as follows Table A ------- empname salary ------- ------ A 1000 B 2000 C 3000 A 1000 B 2000 D 5000 I need the following output: empname salary ------- ------ A 1000 A 1000 B 2000 B 2000 Thanks in advance

10 Answers   IBM,


What are the different SQL Server Versions you have worked on?

0 Answers  


What is the importance of three tier architecture?

0 Answers   QuestPond,


Simple example for difference between select and cursor in sql

1 Answers  


What area unit the various kinds of info compression introduced in sql server 2008?

0 Answers  


what is difference between Enterprise Manager and Query Analyer

6 Answers   CTS,






Categories