Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bulk insert
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Titre:
Divers
Thread ID:
01034449
Message ID:
01034466
Vues:
16
What is the question?

> I am using the bulk insert command to insert data into temp table. However, when I execute the command I am getting the following error:
>
>Server: Msg 4861, Level 16, State 1, Line 1
>Could not bulk insert because file 'C:\Temp\Sql\Udf_Encry_Field.sql' could not be opened. Operating system error code 3(The system cannot find the path specified.).
>
>Here is my code
>
>BEGIN
>
> DECLARE @SQLsp as NVARCHAR(4000),
> @PathFileName nVarchar(2000),
> @SQL varchar(2000)
>
> Set @PathFileName = 'C:\Temp\Sql\Udf_Encry_Field.sql'
>
> --Temporary table for getting the SP
> if object_id('tempdb..#tmpSP') IS NOT NULL
> DROP TABLE #tmpSP
>
> CREATE TABLE #tmpSP (spText NVARCHAR(4000))
>
> --Gets the SP from .sql to Temp table
> SET @SQL = 'BULK INSERT #tmpSP FROM ' + char(39) + @PathFileName + char(39)
> Exec (@SQL)
> --Get the complete SP to a Variable to execute it
>
> --SELECT @SQLsp = spText FROM #tmpSP
>
> --Execute the SP
> --EXECUTE sp_executesql @SQLsp
>
>END
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform