In Redis, the ZSCORE
command returns the score of the specified member of a sorted set.
Author: Ian
Fix Error Msg 8116 “Argument data type datetime2 is invalid for argument 1 of isdate function” in SQL Server
If you’re getting an error that reads Argument data type datetime2 is invalid for argument 1 of isdate function, it’s because you’re passing a datetime2 value to the ISDATE()
function, but this function doesn’t work with datetime2 values.
To fix this issue, either pass a valid date type or use the work around below to provide similar functionality that works with datetime2 values.
Continue readingHow TRY_PARSE() Works in SQL Server
In SQL Server, the TRY_PARSE()
function returns the result of an expression, translated to the requested data type, or NULL
if the conversion fails.
Basically, it works the same as the PARSE()
function, except that it returns NULL
instead of an error if the cast fails.
Both functions are intended for converting string values to either date/time or number types.
Continue readingHow PARSE() Works in SQL Server
In SQL Server, the PARSE()
function returns the result of an expression, translated to the requested data type.
Basically, it enables us to parse a string expression to the specified data type. It’s intended for converting string values to either date/time or number types.
The PARSE()
function can be handy when attempting to convert with CAST()
or CONVERT()
fails. The PARSE()
function is able to parse the expression, and this may result in certain values being converted that wouldn’t normally be able to be converted.
Redis ZRANGEBYLEX Replacement
Starting with Redis 6.2.0, the ZRANGE
command added the REV
, BYSCORE
, BYLEX
and LIMIT
options. The addition of the first three options means that the ZRANGE
command can now do what the ZREVRANGE
, ZRANGEBYSCORE
, ZREVRANGEBYSCORE
, ZRANGEBYLEX
and ZREVRANGEBYLEX
commands can do.
As a result, those commands are now deprecated (as of Redis 6.2.0).
Therefore, we should no longer use the ZRANGEBYLEX
command. Instead, we should use the ZRANGE
command with the BYLEX
argument.
Redis HSTRLEN Command
The Redis HSTRLEN
command allows us to get the length of a value that’s stored in a hash. It returns the string length of the value associated with the specified field at the hash stored in the specified key.
Fix: “ERR wrong number of arguments for ‘smismember’ command” in Redis
If you’re getting an error that reads “ERR wrong number of arguments for ‘smismember’ command” in Redis, it’s because you’re calling the SMISMEMBER
command with the wrong number of arguments.
To fix this issue, make sure you’re passing the correct number of arguments. This command accepts two or more arguments, which represents a key and one or more members to check against that key.
Continue readingHow to Convert Dates in SQL Server
When it comes to converting date and time values in SQL Server, things can get a little complex. But in this article I hope to demystify this topic for anyone who’s confused when it comes to making conversions between dates and other data types, as well as changing the format of date/time values, and other considerations.
Let’s jump straight in.
Continue readingRedis ZUNIONSTORE Command Explained
In Redis, the ZUNIONSTORE
command works in the same way that ZUNION
works, except that it stores the result in a key that we specify.
In other words, it computes the union of the specified sorted sets, then stores the result in the specified key.
Continue readingRedis ZUNION Command Explained
In Redis, the ZUNION
command returns the union of the specified sorted sets.