First, define a used defined table type to use:
CREATE TYPE names as TABLE
(
FirstName varchar(10),
LastName varchar(10)
)
GO
Create the stored procedure:
CREATE PROCEDURE prInsertNames
(
@Names dbo.Names READONLY -- Note: You must specify the READONLY
)
AS
INSERT INTO dbo.TblNames (FirstName, LastName)
SELECT FirstName, LastName
FROM @Names
GO
Executing the stored procedure:
DECLARE @names dbo.Names
INSERT INTO @Names VALUES
('Zohar', 'Peled'),
('First', 'Last')
EXEC dbo.prInsertNames @Names