If you encounter error Msg 15123, Level 16, reading “The configuration option ‘Agent XPs’ does not exist“, you were probably trying to execute EXEC SP_CONFIGURE 'Agent XPs' while advanced options are hidden.
This error is easily fixed.
If you encounter error Msg 15123, Level 16, reading “The configuration option ‘Agent XPs’ does not exist“, you were probably trying to execute EXEC SP_CONFIGURE 'Agent XPs' while advanced options are hidden.
This error is easily fixed.
It’s quite easy to encounter error Msg 214, Level 16 when executing stored procedures such as sp_executesql or sp_describe_first_result_set.
Fortunately it’s easy to fix too!
The most common reason for getting this error is that you forgot to prefix your string with N.
Therefore, to fix this issue, try prefixing your string with N.
Here are three T-SQL functions that you can use to extract the month from a date in SQL Server.
One of the great things about database views, is that they allow you to run complex queries without needing to know the underlying database schema.
Yes, it’s true that you need to know the underlying schema when you create the view, but you only need to do that once. Once you’ve created it, you can query that view all day long without needing to remember all the table and column names, etc.
Views typically combine data from multiple tables into a single, virtual table, which makes it kind of like a “black box”. As long as it works as designed, you don’t need to concern yourself with the hidden details.
But what if you do want to check a view for its underlying tables and columns?
The SET FORCEPLAN statement overrides the logic used by the SQL Server query optimizer to process a T-SQL SELECT statement.
More specifically, when FORCEPLAN is set to ON, the query optimizer processes a join in the same order as the tables appear in the FROM clause of a query.
This also forces the use of a nested loop join unless other types of joins are required to construct a plan for the query, or they are requested with join hints or query hints.
You can use the T-SQL function DATEPART() to return the week number from a date in SQL Server.
By “week number” I mean the week’s number within the year of the specified date.
If you need to extract the ISO week number from a date in SQL Server, you can use the iso_week argument when calling the DATEPART() function. You can alternatively use the isowk or isoww arguments to do the same thing.
By “ISO week”, I’m referring to the ISO 8601 date and time standard.
In SQL Server, you can use the RIGHT() function to extract the right part of a string.
It works exactly the same as the LEFT() function (which returns the left part of a string), except that it returns the right part of the string.