I need to use xp_cmdshell to execute a stored procedure that is my c:
The name of the stored procedure is Script22.sql
I have seen the following example on the internet:
exec master.dbo.xp_cmdshell 'osql -E -Sserver1 -i c:\tempightly.sql'
But i think that in SQL Server 2005 the OSQL was replace by CMDSQL, am i correct?
How can i alter this command so that it runs the script in cmdSQL and if the script raises any error, i can catch it?