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.
| Author |
Topic |
|
sadbjp
INNER JOIN
41 Posts |
Posted - 2007-05-11 : 12:35:43
|
| I have three tables:1. RubricReport 2. RubricReportDetail and 3. RubricReportTemplateRubricReportDetail has columns ReportID and AgeRubricReportTemplate has columns IndicatorID and SalaryI want to insert a row in RubricReport Table with ReportID = @ReportID (RubricReportDetail) and IndicatorID = @IndicatorID (of RubricReportTemplate). How can I do this?Kindly help me with this. Thanks in advance. |
|
|
sshelper
Posting Yak Master
216 Posts |
Posted - 2007-05-11 : 12:40:14
|
| Try this query:INSERT INTO RubricReport ( ReportID, Age, IndicatorID, Salary )SELECT A.ReportID, A.Age, B.IndicatorID, B.SalaryFROM RubricReportDetail A, RubricReportTemplate BWHERE A.ReportID = @ReportID AND B.IndicatorID = @IndicatorIDSQL Server Helperhttp://www.sql-server-helper.com |
 |
|
|
|
|
|