I am trying to use the command bcp by means of a query with xp_cmdshell the problem when executing it I skipped an error of Unable to open the file. But if I execute the same by command lines it works perfectly. The user I'm using has sysadmin permissions
exec xp_cmdshell 'bcp "Prueba.dbo.tabla" out "C:\Users\Usuario\Documents\prueba.txt" -c -T -t -r'
The error that shows me is this