SQL Server Agent: Difference between revisions

Content deleted Content added
No edit summary
Citation bot (talk | contribs)
Altered url. URLs might have been anonymized. | Use this bot. Report bugs. | Suggested by Abductive | Category:Articles lacking in-text citations from March 2025 | #UCB_Category 343/690
 
(30 intermediate revisions by 18 users not shown)
Line 1:
{{unreferencedinline|date=JuneMarch 20112025}}
'''SQL Server Agent''' is a process which executes [[SQL]] jobs and handles other automated tasks. It can be configured to run automatically when the [[Booting|system boots]] or it can be started manually. It is a component of [[Microsoft SQL Server]].
 
'''SQL Server Agent''' is a component of [[Microsoft SQL Server]] which schedules jobs and handles other automated tasks.<ref>[https://docs.microsoft.com/en-us/sql/ssms/agent/sql-server-agent 'SQL Server Agent' page on Microsoft Developer Network]</ref> It runs as a [[Windows service]] so it can start automatically when the [[Booting|system boots]] or it can be started manually.
SQL Agent Configuration
Behind the scenes, SQL Agent Job definitions are specified in the msdb database. You might remember the msdb database from a previous lesson. It is a system database that is created when you first install SQL Server.
 
Typical system tasks performed include scheduling maintenance plans (such as backups), handling [[SQL Server Reporting Services|Reporting Services]] subscriptions and performing [[log shipping]] sub-tasks (backup, copy, restore & check). User tasks, such as scheduling some [[T-SQL]] or command line statement are also common.
You don't really need to know that in order to use the SQL Agent Service though. You can configure SQL Server Agent jobs, alerts and operators via Enterprise Manager. Applications that use SQL-DMO or Transact-SQL with a standard database API can also do this, but for now, we'll stick with Enterprise Manager.
 
SQLAgent has support for operators and alerts, so that administrators can be notified, e.g. by email.
 
==References==
Is the SQL Server Agent Running?
{{Reflist}}
By looking at the screen shot above, I can tell that the SQL Server Agent Service is not running. The icon is what gives it away. Here's what the icon should look like:
{{refbegin}}
:*{{cite book |last1=LeBlanc |first1=Patrick |title=Microsoft SQL Server 2012 Step by Step |date=15 February 2013 |publisher=[[Pearson Education]] |isbn=978-0-7356-7003-7 |url=https://books.google.com/books?id=Ua1CAwAAQBAJ |access-date=29 March 2025 |language=en}}
:*{{cite book |last1=Rankins |first1=Ray |last2=Bertucci |first2=Paul |last3=Gallelli |first3=Chris |last4=Silverstein |first4=Alex T. |title=Microsoft SQL Server 2012 Unleashed |date=9 December 2013 |publisher=[[Sams Publishing]] |isbn=978-0-13-340851-5 |url=https://books.google.com/books?id=NeBPAgAAQBAJ |language=en}}
 
{{refend}}
Running
Not Running
The reason I'm re-iterating this is because I have been caught out so many times with this. It's so easy to create a SQL job that its so easy to forget to check whether the SQL Server Agent is even running. Normally, in a production environment, the SQL Server Agent will be running constantly. In a development environment, you may choose to disable it until you need to test it.
 
[[Category:Database management systems]]
[[Category:Relational database management systems]]
[[Category:SQL]]
[[Category:Microsoft database software]]
[[Category:Microsoft server technology]]
 
[[Category:Windows Server System]]
 
{{Microsoft-software-stub}}