EstuardoSierra
Programmer
Hello All:
Since a couple of hours ago i'm trying to Insert some rows in to another table. My problem is that i can't figure out how to insert values from a recordset (Select) and at the same time insert other values from passed parameters.
This is the common way usign a recordset
Insert into tblname (fld1,fld2,fld3..)
Select fld1a, fld1b, fld1c..
From tblname2
This is the common way with values
Insert into tblname (fld1,fld2,fld3..)
Values ('fld1a', 'fld1b', 'fld1c'..)
But what i want to do is the best of both worlds
@value4 nvarchar(16)
AS
Insert into tblname
Values (Select fld1a, fld1b, fld1c, @value4)
From tblname2
I know my aproach is a mess but i really ran out ideas
can someone help me to achive the same result please?
Thanks in advance
Estuardo
Since a couple of hours ago i'm trying to Insert some rows in to another table. My problem is that i can't figure out how to insert values from a recordset (Select) and at the same time insert other values from passed parameters.
This is the common way usign a recordset
Insert into tblname (fld1,fld2,fld3..)
Select fld1a, fld1b, fld1c..
From tblname2
This is the common way with values
Insert into tblname (fld1,fld2,fld3..)
Values ('fld1a', 'fld1b', 'fld1c'..)
But what i want to do is the best of both worlds
@value4 nvarchar(16)
AS
Insert into tblname
Values (Select fld1a, fld1b, fld1c, @value4)
From tblname2
I know my aproach is a mess but i really ran out ideas
can someone help me to achive the same result please?
Thanks in advance
Estuardo