Sample Header Ad - 728x90

SqlBulkCopy - How to force it to use a renamed bcp file

0 votes
0 answers
66 views
I'm trying to read data from XEL files and input to a SQL Server table.
$bcp = New-Object System.Data.SqlClient.SqlBulkCopy($connectionString)
$bcp.DestinationTableName = "dbo.InputXELData"
$bcp.WriteToServer($dt);
$bcp.Dispose()
Our servers has both ASE and MSSQL bcp utilities installed on the same server, so we had to rename the SQL Server bcp as "mssqlbcp". Now here is the problem, SqlBulkCopy is not working and it is using ASE bcp and no data is been read out of extended event files. Tested on the server which do not have ASE bcp, and it worked fine. My question is how can we force SqlBulkCopy to read the "mssqlbcp" rather than ASE "bcp". Tried looking here but no luck, https://learn.microsoft.com/en-us/dotnet/api/system.data.sqlclient.sqlbulkcopy?view=netframework-4.8.1 Thanks for your help.
Asked by Kris (452 rep)
Oct 18, 2024, 08:20 PM
Last activity: Oct 30, 2024, 02:29 PM