Fix Msg 8116 “Argument data type date is invalid for argument 1 of substring function” in SQL Server

If you’re getting SQL Server error Msg 8116 with text that reads Argument data type date is invalid for argument 1 of substring function, it’s because you’re passing the wrong data type to a function – in this case, the SUBSTRING() function.

You could also see the same error (Msg 8116) in many other contexts – it’s not limited to the SUBSTRING() function.

Read more

Fix Msg 8114 “Error converting data type varchar to numeric” in SQL Server

If you’re getting SQL Server error Msg 8114 that reads something like Error converting data type varchar to numeric, it’s probably because you’re trying to perform a data type conversion that fails due to the value not being able to be converted to the destination type.

It’s not because you can’t convert that type to the new type. It’s because of the value itself.

Read more

5 Ways to Check a Column’s Data Type in SQLite

In SQLite, there are quite a few ways to look at a table’s structure. Therefore, there are quite a few ways we can check the data type of the columns within that table.

There’s also a function that allows us to check the data type of a column returned in a query.

Here are five ways to check the data type of a column in SQLite.

Read more