The following is a proc to accept a data table as parameter and insert it to another table:
CREATE PROCEDURE [dbo].[InsertData]
@TableType TableType readonly
insert into [dbo].DataList select * from @TableType;
When I run this code, I get "Parameter or variable '@TableType' has an invalid data type."
Q1: What is correct syntax for line @TableType TableType readonly?
Q2: Could you please code to create a sample table with two lines of data so I could test this proc?
fileID filename createdOn
1 File_1 2014-02-26
2 File_2 2014-03-28
Note that fileID is identity column.