Search code examples
sql-serversql-server-2008sql-server-2008-r2sqlcmd

create Scheduler task to invoke SQLCMD


I have a Requirement where i have to run a SQL Script in SQL server on a weekly basis .Result of this script has to be mailed.I want to automate this process.I don't want to go with SSIS Jobs. I have searched i have found few options like Creating a Windows Scheduler task to invoke a SQLCMD.Can Someone Assist on how to create Scheduler task to invoke SQLCMD


Solution

  • Your best bet would be to create a Console Application which executes the SQL Command and performs the email.

    You can then use setup a task under Task Scheduler to use the Start a program option and run it on the schedule you prefer.