Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
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.somecol2FROM Table1 a INNER JOIN Table2 b ON a.matchCol = b.matchCol