Skip to content
Microsoft SQL Server

SQL Server Error 8114

Error converting data type X to Y

Applies to: All supported SQL Server versions (2016 to 2025), Azure SQL Database, Azure SQL Managed Instance
Last technically reviewed 23 October 2026 on SQL Server 2025 (17.0.1145.4)
The full message
Msg 8114, Level 16, State 5, Line 1
Error converting data type varchar to numeric.
Other forms of this message
Raised by a procedure parameter (SSMS, .NET SqlClient)
Msg 8114, Level 16, State 5, Procedure dbo.SetPrice, Line 0
Error converting data type varchar to numeric.
Same error as printed by sqlcmd for a parameter
HResult 0x1FB2, Level 16, State 5
Error converting data type varchar to numeric.
Other target types
Msg 8114, Level 16, State 5, Line 1
Error converting data type varchar to float.

Msg 8114, Level 16, State 5, Line 1
Error converting data type varchar to bigint.

Msg 8114, Level 16, State 5, Line 1
Error converting data type nvarchar to numeric.
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
Last reviewed
23 October 2026

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 abc or 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;
What to look for

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;
What to look for

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 side

When 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-only

Strip 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-only

TRY_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-only

For 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';
Result
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;
Result
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;
Result
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.

Still stuck on a SQL Server error?

Browse the full SQL Server error library, or get hands-on help from an experienced SQL professional.