Click here to Skip to main content
15,915,632 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
HEllO,

how can i retrieve the row values in the table using asp.net?

for Example i have two tables in database SQL SERVER 2005 with same fields. in first table it contains 3 rows of data and the second table is empty,
if i select the Third row in the first table it will be store in the second table.(Note:Third row only Saved in that Second table)
Posted
Updated 16-May-12 20:06pm
v5
Comments
bhagirathimfs 17-May-12 1:41am    
Please explain briefly..
AmitGajjar 17-May-12 1:45am    
post your code.....
Code 89 17-May-12 1:45am    
post your code
MAKReddy 17-May-12 1:46am    
post ur requirent briefly
MAKReddy 17-May-12 1:46am    
or post ur code

1 solution

Hi ,
check this
SQL
Create PROCEDURE usp_test
(@name nvarchar(50))
AS
BEGIN
IF NOT EXISTS(select name from  dbo.Table_2 where  name=@name)
Begin
INSERT INTO dbo.Table_2 (name)
SELECT name FROM dbo.Table_1  WHERE name =@name
END
 ELSE
   BEGIN
   select -1
   END
END


Best Regards
M.Miotwalli
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900