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

1.how to find the dead lock in sql server? 2.How to fine the memory leaks in sql server? 3.suppose transaction log file increasing what action will take ?

0 Answers  


What is the difference between seek predicate and predicate?

0 Answers  


What is the maximum row of a size?

0 Answers  


What does executeupdate return?

0 Answers  


How optimize sql query with multiple joins in sql server?

0 Answers  






Explain database normalization?

0 Answers  


What is outer join in sql server joins?

0 Answers  


What do you understand by user-defined function in the sql server?

0 Answers  


What do you understand by sql server agent?

0 Answers  


what is curser.

9 Answers  


what is an extended stored procedure? : Sql server database administration

0 Answers  


What is sql server agent and what are the two modes of authentication in sql server?

0 Answers  


Categories