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.
George writes "SQL server 2005 Express, Windows XP Pro SP2I want to create a stored procedure that will insert a record in a child table (tblcontproj)propulating two columns with columns from the parent (InterestListoriginal)and two columns with user selected values. I created an insert select statement that looks like .." INSERT INTO tblcontproj(proj_rpt_id, proj_name) SELECT proj_rpt_id, project_name FROM InterestListoriginal WHERE (proj_rpt_id = @proj_rpt_id)"This works great! Now can I add two columns to the INTO clause for projcontshortname and projconttye and use a VALUE clause that sets tblcontproj.projcontshortname and tblcontproj.projconttype to @projcontshortname and @projconttype which are user selected values from a downdownlist.Or add an UPDATE query?Thanks "
Kristen
Test
22859 Posts
Posted - 2006-03-22 : 14:45:25
"use a VALUE clause"Nope, not quite!
INSERT INTO tblcontproj( proj_rpt_id, proj_name, projcontshortname, projconttye)SELECT proj_rpt_id, project_name, @projcontshortname, @projconttypeFROM InterestListoriginal WHERE (proj_rpt_id = @proj_rpt_id)