In a previous article about creating a SQL Server Agent job with T-SQL, I demonstrated how to create a job with a single step.
In this article, I’ll show you how to create a job with multiple steps.
In a previous article about creating a SQL Server Agent job with T-SQL, I demonstrated how to create a job with a single step.
In this article, I’ll show you how to create a job with multiple steps.
A LEFT SEMI JOIN is kind of a half-join. It returns any distinct values that are returned by both the query on the left and right sides of the query.
However, when using T-SQL in SQL Server, if you try to explicitly use LEFT SEMI JOIN in your query, you’ll probably get the following error:
A LEFT ANTI SEMI JOIN is a type of join that returns only those distinct rows in the left rowset that have no matching row in the right rowset.
But when using T-SQL in SQL Server, if you try to explicitly use LEFT ANTI SEMI JOIN in your query, you’ll probably get the following error:
The following table contains a list of the date formats that you can provide to the CONVERT() function when you convert a date/time value to a string.
These formats are provided as an optional third argument when calling the CONVERT() function. They’re provided as an integer expression that specifies how the CONVERT() function will format the date.
When using T-SQL, you can use the sp_add_schedule stored procedure to add a SQL Server Agent schedule.
This procedure creates the schedule, but it doesn’t attach it to any jobs. To attach it to a job, you must use the sp_attach_schedule procedure.
You can also use sp_add_jobschedule to create the schedule and attach it all with the same procedure.
Often the quickest way to get a list of SQL Server Agent jobs is to simply expand the SQL Server Agent node in the SSMS Object Explorer.
But that’s not the only way. And depending on your environment, it might not even be an option. If you don’t have SSMS or a database tool that allows you to see the SQL Server Agent jobs, you may need to use T-SQL instead.
In this article, I present three options for returning a list of SQL Server Agent jobs when using T-SQL.
In this article, I present four options for returning SQL Server Agent job history data.
If you get error Msg 15281, Level 16 in SQL Server, chances are you’re trying to run an ad hoc distributed query, but you haven’t enabled ad hoc distributed queries.
This can be fixed easily by enabling ad hoc distributed queries.
In SQL Server, the sp_help_schedule stored procedure returns information about schedules in the SQL Server Agent.
This article provides an overview of this stored procedure including examples.