Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

S2K5 Not Liking my Bulk Insert Syntax

Status
Not open for further replies.

SQLJoe

Technical User
Dec 8, 2010
43
US

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.

 

Please disregard, thanks. Brain gas on my part. I wish there were a way to delete our own posts. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top