I'm trying to run an xp_cmdshell from a(n) SQLwindow (ssms). Like this:
xp_cmdshell 'sqlcmd -U username -P tom&jerry -S server -d database -i C:\temp\test.sql -o C:\temp\test.csv -s"," -y0'
it errors: Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Login failed for user 'username'.. 'jerry' is not recognized as an internal or external command, operable program or batch file.
How do I make it see tom&jerry as a whole, as the password, rather than the & cutting it off?
Thank you!