Quantcast
Channel: Forum SQL Server Database Engine
Viewing all articles
Browse latest Browse all 15889

BULK INSERT in SQL Server 2012 on Windows 2012 Keepings File Locked for Windows XP clients

$
0
0

Hi,

We have a .NET Framework 2.0 app that uses ADO.NET to issue a BULK INSERT command from a text file into SQL Server 2012 database table. After the insert finishes, the app deletes the file that was processed.

We have this app running a Windows XP machine.

The app works perfectly fine when the files are imported into a SQL Server 2000 on Windows 2003 (32-bit). However, when the same exact app is used to import the same exact files into a SQL Server 2012 on Windows 2012 (64-bit), it is not able to delete the file after the import finishes. The .NET Framework File.Delete() command throws and exception saying that the file is being used by another process.

When the same exact app is run on a Windows 7 or a Windows 2008 Server machine it does the import and deletes the file without any issues.

The permissions are identical on all apps - it is NOT a permissions issue.

It appears that there is some kind of a compatibility problem between Windows XP/2003 and SQL Server 2012 on Windows 2012 that makes the client machine think that the file is "still being used" by SQL Server after the BULK INSERT is complete. It appears that the file continues to be used for about 10 seconds or so.

Is it possible that SQL Server is setting some kind of a new lock type on the file while doing the BULK INSERT that is not recognized by Windows XP or 2003?

Thanks,
AV


Viewing all articles
Browse latest Browse all 15889

Trending Articles