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 ?    9 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

Do you know what is rank function?

0 Answers  


How can I know what query is executing by by a particural user? (using sp id or any othe way.)

2 Answers  


Can an entity have two primary keys?

0 Answers  


What is an index?

8 Answers   Yardi Software,


How to handle errors in Stored Procedures. I want to display a message to the user in the .aspx page that is calling a stored procedure in it's code behind. please help me.

2 Answers   247Customer,






how can do you the system monitoring?

1 Answers  


Simple example for difference between select and cursor in sql

1 Answers  


what is the difference detween pairwise comparison subquary and non pairwise comparison subquary?

2 Answers  


How to replace the Query Result 'Null Value' with a text ?

0 Answers   MCN Solutions,


Explain SELF JOIN ?

3 Answers   ADP,


What is primary key index?

0 Answers  


Is sql server difficult to learn?

0 Answers  


Categories