I am working with SQL and what I want is that every time I execute the xp_cmdshell
command, a new file is generated, since as I currently have it, write the same one, I leave the code of my query :
DECLARE @Comando VARCHAR(2048)
SET @Comando = 'bcp "Select * FROM DataBase.dbo.Table" '
+ 'queryout "C:\SAP\Prueba.txt" '
+ '-S "WIN-7A84OQD1HG6\SQLEXPRESS" '
+ '-U "sa" -P "123" -c'
EXEC xp_cmdshell @Comando;