SET NOCOUNT ON
/* Create a temporary table to store the data in the text file. Maximum character is 8000. */
CREATE TABLE #tempfile (line varchar(8000))
/* Insert data from the text file to the temporary table */
EXEC ('bulk INSERT #tempfile FROM "' + 'C:\Sample.txt' + '"')
/* Return the data in the text file. */
SELECT * FROM #tempfile
/* Drop the temporary table. */
DROP TABLE #tempfile
No comments:
Post a Comment