Search code examples
asp.net-mvcmultithreadingsqlbulkcopy

SqlBulkCopy multiple tables in ASP.NET MVC unblockable


I have to make a multiple copy of tables from one database to other with SqlBulkcopy from an ASP.NET MVC application.

The process takes more than 2 minutes, and I do not trust users.

Which is the best way to do the entire process, even if the user closes the window?


Solution

  • Don't do such processes in an ASP.NET application. Read this article to understand why. So do this task in a separate process than your application: a Windows service, a scheduled console application, ...