Hi, I am running BCP command to copy the data from a file to the database in a while loops. as the number of iterations goes up, the memory usage is grown to the extreme and it consumed all my 64 GB space. My system is crashed.
How could I release the memory or How could I force the SQL Server to release the memory used by the BCP
declare @currentIteration intset @currentIteration = 1
while @currentIteration <=5000
begin
exec master..xp_cmdShell 'bcp MyDB.dbo.Invoice01 in "D:\DataFiles\DataToDump_100.txt" -e"D:\DataFiles\error100.txt" -b 100 -t"|" -T -c'
end