I have a text file
C:\abc.txt with a number 5 in the first line. I need to increment it into 6.
Please help me with the T_SQL syntax.
I have tried the following query to read the value but not able to update it.
DROP TABLE #UserLocation CREATE TABLE #UserLocation(UserId numeric(3,0)) BULK INSERT #UserLocation FROM 'C:\ABC\ABC.txt' -- Path to the file.If this file is on server,be sure this file exists on the server. WITH ( ROWTERMINATOR ='\n', -- New Line Feed (\n) automatically adds Carrige Return (\r) FIELDTERMINATOR = '\t', --delimiter FIRSTROW = 1 ) PRINT 'File data copied to Temp table' SELECT * FROM #UserLocation