Posted by Maury on 04/03/06 14:42
I'm trying to write a SP that
accept in input a parameter with the name
of a file (with complete path)
but I noticed some problems....
It's right this way? Thanks!
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER PROCEDURE [dbo].[BI]
@FileToImport nvarchar(100)
AS
BEGIN
SET NOCOUNT ON;
DECLARE @SQL nvarchar(200)
SET @SQL = "BULK INSERT tmptable FROM '"+@FileToImport+"'"
EXEC (@SQL)
END
Navigation:
[Reply to this message]
|