Is it possible to execute a text file from SQL query? June 13, 2023 by Tarik use xp_cmdshell and sqlcmd EXEC xp_cmdshell 'sqlcmd -S ' + @DBServerName + ' -d ' + @DBName + ' -i ' + @FilePathName