sql help

rjhe22

Well-known member
Joined
May 22, 2008
Messages
88
Programming Experience
Beginner
i have this piece of code
SELECT EntryID FROM dbo.Receipt
WHERE ReceiptID = @ReceiptID
and i neeed to get the entry id into a table called documentdeletetask. and i need to put it under the column name documentdeletetaskid

and ideas is it just an insert


sorry i stated that wrong.

i have a table called entrytask in it there is
entryid
userid and taskid

i want to put them into the documentdeletetask table into the fields
documentdeleteraskid
taskid
and userid
 
am i anyway near it with this

INSERT INTO dbo.DocumentDeleteTask
( DocumentDeleteID,
TaskID ,
UserID )
SELECT ddq.DocumentDeleteID,
et.TaskID ,
et.UserID

FROM dbo.DocumentDeleteQueue ddq
inner
join dbo.EntityName et
on et.EntryID = ddq.DocumentDeleteID

and if so where am i going wrong cause im gettin errors
 

Latest posts

Back
Top