Dear Experts,I am trying to execute a stored procedure through sqlcmd connecting to a remote database from a batch script. While I am able to connect to the remote server, its throwing error to execute the Tsql script. Here is the batch script I am executing -:MAIN'C:\Program Files\Microsoft SQL Server\100\Tools\Binn\sqlcmd.exe' -Spportal52.db.111111.hosted.com -Uportal123 -Pxxxxxxx -dportal123 -Q"EXEC C:\Documents and Settings\sr\Desktop\ftp test\sps_filercvdts_import.sql 'C:\list_of_file_tsrcvd.txt'"
This is the error I am getting -C:\Documents and Settings\sr\Desktop\ftp test>"C:\Program Files\Microsoft SQL Server\100\Tools\Binn\sqlcmd.exe" -Spportal52.db.111111.hosted.com -Uportal123 -Pxxxxxxx -dportal123 -Q"EXEC C:\Documents and Settings\sr\Desktop\ftp test sps_filercvdts_import.sql 'C:\list_of_file_tsrcvd.txt'"Msg 102, Level 15, State 1, Server P3NWDSHSQL009, Line 1Incorrect syntax near 'C:'.
The password field above is masked. I guess it's because my sql file is on my local drive C:\ whereas my sqlcmd connects to the remote db and expects to see the sql file over there. Request the experts to throw some light on this as to how do I execute my local sql file when I connect to the remote db through sqlcmd.Also note that I am passing a text file as an input to the sql file which will load the text file to the table.Thanks in advance and appreciate your response.Thanks,Sanders