We have 2 SSIS packages. One of the packages needs bcp version 12 and the other needs bcp version 15. Can we have 2 versions of the bulk copy utility on the same server.
Yes, BCP allows for multiple installations on a machine. For example, on my machine
C:\>cd "Program Files"
C:\Program Files>dir /s /b bcp.exe
C:\Program Files\Microsoft SQL Server\110\Tools\Binn\bcp.exe
C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\bcp.exe
C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\bcp.exe
C:\Program Files>cd "\Program Files (x86)"
C:\Program Files (x86)>dir /s /b bcp.exe
C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\bcp.exe
I can see that I have the 64 bit version of bcp that corresponds to 110 (SQL Server 2012), 130 (SQL Server 2016), and .. I have no idea what 170 is as 2019 is 150. Whatever, we can ask the utility itself what version it is and they report back that I have version 11, 14 and 15 installed
C:\Program Files (x86)>"C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\bcp.exe" -v
BCP - Bulk Copy Program for Microsoft SQL Server.
Copyright (C) Microsoft Corporation. All Rights Reserved.
Version: 15.0.2000.5
C:\Program Files (x86)>"C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\bcp.exe" -v
BCP - Bulk Copy Program for Microsoft SQL Server.
Copyright (C) Microsoft Corporation. All Rights Reserved.
Version: 14.0.3445.2
C:\Program Files (x86)>"C:\Program Files\Microsoft SQL Server\110\Tools\Binn\bcp.exe" -v
BCP - Bulk Copy Program for Microsoft SQL Server.
Copyright (C) Microsoft Corporation. All Rights Reserved.
Version: 11.0.2100.60
The only "trick" is to ensure when you invoke them that you provide the correct path otherwise, the first entry in the users PATH windows environment variable will take precedent.