Hot Cool Stud
Hot Cool Stud

Reputation: 1205

Schedule task in sql express edition using batch file

Requirements - Schedule task in SQL Express Edition.

But SQL server Agent functionality is not available in express edition.

Possible Solution- Schedule batch file execution to execute sql script. Tried

Batch File-cmd /k sqlcmd -i backup.sql

Sql Script-backup database DB_user1212 to disk = 'E:\backups\MyBackup.bak'. But error occurred while executing sql script A network related or instance specific error occurred while establishing a connection to SQL Server

Possible Reason- Something like connection string missing. Help me how to solve this, i am using windows authentication for connection.

Upvotes: 1

Views: 2711

Answers (1)

Matt Williamson
Matt Williamson

Reputation: 7095

All you need to do is add the additional parameters to your call to sqlcmd.

 sqlcmd -S yoursqlserver -E -i C:\pathto\backup.sql

Upvotes: 1

Related Questions