Below is a list of date & time styles supported by the CONVERT()
function in SQL Server. These are the styles that can be used as the third argument to indicate how the input value is formatted.
Numeric Styles Supported by CONVERT() in SQL Server
Below is a list of numeric styles supported by the CONVERT()
function in SQL Server. These are the styles that can be used as the third argument to indicate how the input value is formatted.
Redis ZREVRANGEBYLEX 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 ZREVRANGEBYLEX
command. Instead, we should use the ZRANGE
command with the BYLEX
and REV
arguments.
Redis ZSCORE Command Explained
In Redis, the ZSCORE
command returns the score of the specified member of a sorted set.
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 reading