Microsoft introduced the CURRENT_TIMEZONE()
function in SQL Server 2019 for returning the time zone of the server.
More specifically, this function “returns the name of the time zone observed by a server or an instance”.
Continue readingMicrosoft introduced the CURRENT_TIMEZONE()
function in SQL Server 2019 for returning the time zone of the server.
More specifically, this function “returns the name of the time zone observed by a server or an instance”.
Continue readingMongoDB provides various ways to update a document. The method you use will depend on exactly how you want to perform the update.
This article presents 4 ways to update a document in MongoDB.
Continue readingIf you’ve installed the SQL Server Agent extension in Azure Data Studio, you will be able to see a list of SQL Server Agent jobs, as well as create, edit, view history, etc.
But you may be wondering how to delete a job.
If so, read on.
Continue readingIf you encounter the “index name must be a string” error when dropping multiple indexes in MongoDB, it’s probably because you’re passing the specifications document instead of the name.
When you use the dropIndexes()
method or the dropIndexes
command to drop multiple indexes, you need to pass the index names (not the specifications documents) in an array.
If you’re wondering what version of MongoDB you’re running, here are 7 ways you can use to check.
Actually, some of these check your MongoDB server version, and some check your mongo shell version. In any case, let’s take a look.
Continue readingIn SQL Server, you can use the sp_rename
stored procedure to rename a user created object in the current database, including a primary key.
This can be handy if you’ve got a primary key that had its name automatically assigned, and you now want to give it a more readable name.
When you create a primary key without explicitly providing a name for it, SQL Server automatically delegates a name for it. Such names typically include a long numeric suffix, which makes it harder to remember. If you need to refer to that primary key (e.g. in your code, documentation, etc), such names can make your life more difficult. Fortunately, sp_rename
provides a quick and easy way to change this name.
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.
Continue readingA 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:
This article presents 5 ways to return the milliseconds portion from a Date object in MongoDB.
Continue reading