Link to home
Start Free TrialLog in
Avatar of Mike Eghtebas
Mike EghtebasFlag for United States of America

asked on

Bulk insert

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
AS
BEGIN
    insert into [dbo].DataList select * from @TableType; 
END

Open in new window


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

Open in new window


Note that fileID is identity column.
SOLUTION
Avatar of Raheman M. Abdul
Raheman M. Abdul
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
eghtebas, do you still need help with this question?