How To Import Txt Log File Into Sql Server
IF EXISTS ( SELECT  NULL
            FROM    dbo.sysobjects
            WHERE   name = 'temp_LogFileImport' ) 
    TRUNCATE TABLE DBA.dbo.temp_BingoLogFileImport
ELSE 
    CREATE TABLE temp_BingoLogFileImport ( line VARCHAR(8000) )
 
DECLARE @filename NVARCHAR(MAX)
SELECT @filename = 'C:\demo\MyLogFile.log'
 
EXEC ('bulk insert dbo.temp_LogFileImport from "' + @filename + '"')
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License