troubleshooting Question

Insert in 2 tables. Use Id from table 1.

Avatar of johnkainn
johnkainn asked on
Microsoft SQL Server 2005
2 Comments1 Solution206 ViewsLast Modified:
I have two tables.  MyTable1 and MyTable2
I would like to insert a row in MyTable1, get the Id of that row and insert a row into MyTable2 with that Id.
Example:  MyTable1 has id1, Col1.     MyTable2 has id2, id1, Col3
When I have inserted a row in MyTable1 I get id1 and then insert it into MyTable2 along with Col3.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros