Two new stored procedures introduced in SQL Server 2019 are sys.xp_copy_file
and sys.xp_copy_files
, which enable you to copy files.
Prior to SQL Server 2019, you would need to use xp_cmdshell
, which spawns a Windows command shell and passes in a string for execution. The new stored procedures introduced in SQL Server 2019 allow you to copy files without relying on xp_cmdshell
.