Search

Showing posts with label Start. Show all posts
Showing posts with label Start. Show all posts

Monday, April 13, 2015

Start, Stop and Disable the job in SQL Server 2008

1) Use below procedure to start the Job in SQL

Exec msdb.dbo.sp_start_job @job_name = N'Job_Name'

Example:
Exec msdb.dbo.sp_start_job @job_name = N'Job_Name'


OR

Exec msdb.dbo.sp_start_job  N'Job name'

2) Use below procedure to stop the Job in SQL

Exec msdb.dbo.sp_stop_job @job_name = 'Job_Name'

Example:
Exec msdb.dbo.sp_stop_job @job_name = N'Job_Name'

OR

Exec msdb.dbo.sp_stop_job  N'Job name'

3) Use below procedure to enable or disable the Job in SQL

To enable the Job:

EXEC msdb.dbo.sp_update_job @job_name = N'Job_Name', @enabled = 1

To disable the Job:

EXEC msdb.dbo.sp_update_job @job_name = N'Job_Name', @enabled = 0

Wednesday, April 25, 2012

Start, Stop or Restart SQL Server from Command Prompt

Start SQL Server from command prompt:


net start mssqlserver


If you try to start a SQL Server which is already started then you will get this error: 



The requested service has already been started.
More help is available by typing NET HELPMSG 2182.

Stop SQL Server from command prompt:


net stop mssqlserver



If you try to stop a SQL Server which is already stopped then you will get this error: 


The SQL Server (MSSQLSERVER) service is not started.
More help is available by typing NET HELPMSG 3521.

Restart SQL Server from command prompt:


net stop mssqlserver
net start mssqlserver