Hi,
delete the ' around your selects, now you are trying to insert the string 'select employeename from employee where content_id=@userid' into the column modifiedby, and that column can't take the 61 character.
Have a nice day
Hi, use an Insert with a Select:
Alter Procedure approve
(
@leaveid int,
@status int,
@userid int
)
AS
begin
update leaves set status=@status where contentid=@leaveid
insert into reportingperosnreport
(empid,leaveid,status,applydate,applyiedby,isrmapproved,rmapproveddate,rmapprovedby,ismanagerapproved,approvedate,
approvedby,iscancelled,modifieddate,modifiedby)
SELECT
ll.employeeid, @leaveid, ll.status,...,e.employeename
FROM leaves ll, leaves lu, Employee e
WHERE ll.contentid=@leaveid AND lu.content_id=@userid AND e.content_id=@leaveid
END