Hi all, I'm having issues creating this procedure. It's not liking the "FROM @FilePath" clause and I don't know why not. The @FilePath variable includes the file name. Any help is appreciated.
create procedure spImport
@FilePath as varchar(200)
as
begin
BULK
INSERT dbo.tblGifts
FROM @FilePath
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
end
ERRORS:
Msg 102, Level 15, State 1, Procedure spImport, Line 10
Incorrect syntax near '@FilePath'.
Msg 319, Level 15, State 1, Procedure spImport, Line 11
Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon.