Execute the following
SQL Server T-SQL script in SSMS Query Editor to sequentially number a CSV textfile prior
to importing it into the database. The assumption is that each
line contains at least one comma.
declare @command varchar(256)
set @command = 'findstr /N "," textfile.txt
> textfileseq.txt '
exec xp_cmdshell @command