Reading an Text file from Sql server

Pavanandey
Posted by Pavanandey under Sql Server category on | Points: 40 | Views : 2258
Create proc [dbo].[readTextFile] @filename sysname,@OutputTest varchar(100)=null OUTPUT
as
begin
set nocount on
Create table #tempfile (line varchar(8000))
exec ('bulk insert #tempfile from "' + @filename + '"')
drop table #tempfile
End


using the proc above we can read the data into a temp file and work on it

Comments or Responses

Login to post response