- Error number
- 8114
- Severity
- 16 (user-correctable error)
- State
- 5
- Product
- Microsoft SQL Server Database Engine
- Versions
- All supported SQL Server versions (2016 to 2025), Azure SQL Database, Azure SQL Managed Instance
- Category
- Data Type & Conversion
- Last reviewed
- 23 October 2026
On this page
What it means
Error 8114 means SQL Server could not convert a value from the first data type named in the message to the second, most often text that is not a valid number going into numeric, decimal, float or bigint.
The message names only the two types, for example varchar to numeric, never the value or the row. That is the main difference from error 245, which quotes the failing value: on SQL Server 2025, text that fails to convert to int raises 245, while the same text going to numeric, decimal, float or bigint raises 8114.
When the message carries Procedure name, Line 0, the conversion failed while binding a parameter value to the procedure, before its first statement ran: the caller passed a string the parameter type cannot hold. Without a procedure name, look for a CAST or CONVERT, or an implicit conversion where a text column meets a decimal literal or a numeric column.
Common causes
- A caller passes text such as
abcor an empty string with letters to a numeric, decimal or bigint procedure parameter. - Formatted numbers: thousands separators (
1,234.56), currency symbols or trailing spaces with letters converted with CAST or CONVERT. - A varchar column compared to a decimal literal or numeric column, so every row is converted and one bad value fails.
- Imported or staged data in text columns that is converted to numeric types during the load.
Diagnose it
Read-only These queries only read metadata and dynamic management views. They do not change data, permissions or configuration, so they are safe to run first.
Find the values that will not convert
TRY_CONVERT returns NULL instead of failing, so it lists every bad value, which the message does not.
SELECT id, raw_amount
FROM dbo.Imports
WHERE raw_amount IS NOT NULL
AND TRY_CONVERT(NUMERIC(10,2), raw_amount) IS NULL; The rows with text, separators or symbols. Match the type in TRY_CONVERT to the target type in the message.
Check the parameter types of the procedure
SELECT p.name AS parameter_name, TYPE_NAME(p.user_type_id) AS data_type, p.precision, p.scale
FROM sys.parameters AS p
WHERE p.object_id = OBJECT_ID(N'dbo.SetPrice')
ORDER BY p.parameter_id; The declared type of each parameter. Compare it with what the application sends; a string bound to a numeric parameter is the usual cause of the Line 0 form.
How to fix it
Each fix is labelled with what it changes. Try read-only checks and the least invasive fix first, and test changes outside production.
Send the correct type from the application
Client or network sideWhen the message names a procedure, pass a typed numeric parameter rather than a string. In T-SQL, convert once at the boundary and stop with a clear message if the value is not a number.
DECLARE @price NUMERIC(10,2) = TRY_CONVERT(NUMERIC(10,2), '19.99');
IF @price IS NULL
THROW 50000, 'Price is not a valid number', 1;
EXEC dbo.SetPrice @price = @price;
Clean formatted numbers before converting
Read-onlyStrip separators and symbols, or let TRY_PARSE read the value with an explicit culture. On SQL Server 2025, TRY_PARSE('\$1,234.56' AS money USING 'en-US') returns 1234.56.
SELECT CAST(REPLACE(REPLACE('$1,234.56', '$', ''), ',', '') AS NUMERIC(10,2)) AS amount;
SELECT TRY_PARSE('$1,234.56' AS money USING 'en-US') AS amount;
Use TRY_CONVERT where bad values may appear
Read-onlyTRY_CONVERT and TRY_CAST return NULL for values that cannot convert, so one bad row does not stop the statement. Decide what NULL means for the result before relying on it.
SELECT id, TRY_CONVERT(NUMERIC(10,2), raw_amount) AS amount
FROM dbo.Imports;
Compare text to text, or fix the column type
Read-onlyFor an implicit conversion in a WHERE clause, quote the literal so no conversion happens, or store numbers in a numeric column so the comparison is numeric on both sides.
SELECT * FROM dbo.Products WHERE code = '100.50';
Examples
A numeric parameter receiving non-numeric text
CREATE PROCEDURE dbo.SetPrice
@price NUMERIC(10,2)
AS
SELECT @price AS price;
GO
-- The application sends 'abc' where a number is expected
EXEC dbo.SetPrice @price = 'abc';
Msg 8114, Level 16, State 5, Procedure dbo.SetPrice, Line 0 Error converting data type varchar to numeric.
Reproduced on SQL Server 2025 (17.0.1145.4), 23 October 2026.
Converting a string with a thousands separator
-- The comma is not valid inside a numeric literal
SELECT CAST('1,234.56' AS NUMERIC(10,2)) AS amount;
Msg 8114, Level 16, State 5, Line 2 Error converting data type varchar to numeric.
Reproduced on SQL Server 2025 (17.0.1145.4), 23 October 2026.
An implicit conversion inside a query
CREATE TABLE dbo.Products (id INT PRIMARY KEY, code VARCHAR(20));
INSERT INTO dbo.Products (id, code) VALUES (1, '100.50'), (2, 'A100');
-- code is varchar; comparing it to the decimal 100.50 converts every code to numeric
SELECT * FROM dbo.Products WHERE code = 100.50;
Msg 8114, Level 16, State 5, Line 5 Error converting data type varchar to numeric.
Reproduced on SQL Server 2025 (17.0.1145.4), 23 October 2026.
How to prevent it
Type values at the boundary: bind parameters with their real numeric types in application code instead of passing strings, and convert file or form input once with TRY_CONVERT, rejecting anything that comes back NULL.
Keep numbers in numeric columns and match types in joins and filters, so no conversion is needed when the data is read. When numeric text is too large for the target, the error changes to 8115 (arithmetic overflow).
Common questions
Why does CAST('abc' AS int) give 245 but CAST('abc' AS bigint) give 8114?
The engine raises a different message depending on the target type. On SQL Server 2025, failing text to int raises 245, which quotes the value; to bigint, numeric, decimal or float it raises 8114, which names only the types. The fix is the same.
What does Line 0 mean in the 8114 message?
The error happened while SQL Server was converting a parameter value for the procedure, before any line of the procedure ran. Look at the value the caller passed, not at the procedure body.
Does 1.5e3 convert to numeric?
No. Scientific notation fails with 8114 when converted to numeric or decimal, but converts to float (1500). Convert to float first only if the precision of float is acceptable.
Learn more on CodeWithSQL
Official documentation
Last technically reviewed 23 October 2026; examples and diagnostics run on SQL Server 2025 (17.0.1145.4). Message text checked against the engine's sys.messages catalogue.