Reputation: 355
I am going to use the FTP task tool to pull a file into the SQL server from a remote host. Is stored procedure the best way to execute a query contained within the file without doing it manually?
Upvotes: 0
Views: 44
Reputation: 172378
You may try like this:
EXEC xp_cmdshell 'sqlcmd -S ' + @DBServerName + ' -d ' + @DBName + ' -i ' + @FilePathName
Upvotes: 1