I have custom type (Table type) in sql server 2008.
CREATE TYPE RequestingDatesType AS TABLE
(
LeaveDate datetime,
IsHoliday bit
)
I have a store procedure
CREATE PROCEDURE CreateLeaveRequest
@EmployeeId int,
@LeaveTypeId int,
@LeaveDescription varchar(50)
@TableVariable RequestingDatesType READONLY
AS
DECLARE @LeaveId INT
//1st insert command
INSERT INTO tblLeaveMaster(EmployeeId,LeaveTypeId,LeaveDescription)
VALUES(@EmployeeId,@LeaveTypeId,@LeaveDescription)
SET @LeaveId = SCOPE_IDENTITY()
//2nd insert command
INSERT INTO tblLeaveDetails(LeaveId,LeaveDate,IsHoliday)
VALUES(@LeaveId, LeaveDate(*from custom type*), IsHoliday(*from custom type*))
My question is how can i insert values for 2nd insert command