Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 store procedure code

Author  Topic 

rajnidas
Yak Posting Veteran

97 Posts

Posted - 2013-10-31 : 08:05:46
hi every one,

i need sp sample coding

from two table data found match then data insert into 'app id' field using
with cursor condition in store procedure. pls.. need sample coding

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-10-31 : 08:15:12
Doesn't look like you need a cursor to do this. Join the two tables and insert the resulting column(s) into your destination table
INSERT INTO YourTargetTable
([appfield],[othercol1],[othercol2])
SELECT
a.appfield, b.somecol1, a.somecol2
FROM
Table1 a
INNER JOIN Table2 b ON a.matchCol = b.matchCol
Go to Top of Page

rajnidas
Yak Posting Veteran

97 Posts

Posted - 2013-10-31 : 08:27:26

thanks for reply james sir.
Go to Top of Page
   

- Advertisement -