What it means
The call passed more arguments than the procedure or function declares, so SQL Server refused it
without running any of it. For a procedure, sqlcmd 18 prints the number in hexadecimal (0x1FD0 is
8144):
HResult 0x1FD0, Level 16, State 2
Procedure or function add_order has too many arguments specified.
For a user-defined function the usual form appears, with the schema in the name:
Msg 8144, Level 16, State 2, Server 7732422b7f56, Line 1
Procedure or function seo_err_mssql.order_total has too many arguments specified.
A named argument the procedure doesn’t have is error 8145 instead:
@note is not a parameter for procedure add_order. Too few arguments is
error 201.
Common causes
- The code is newer than the database. The application passes a parameter added in a migration that hasn’t run on this server yet: staging has the new procedure, production the old one.
- The wrong procedure. The same name exists in two schemas or databases, and the call (or the connection’s default database or schema) reaches the older one.
- One argument too many by position, such as an old caller still passing a parameter that was removed.
sp_executesqlvalues without declarations. Every value after the second argument needs a matching declaration in the parameter list (N'@id int'); an extra value gives 8144 with a blank procedure name:Procedure or function has too many arguments specified.
How to fix it
Compare the call with what’s on the server
SELECT OBJECT_SCHEMA_NAME(p.object_id) AS [schema], OBJECT_NAME(p.object_id) AS [procedure],
p.parameter_id, p.name AS parameter, TYPE_NAME(p.user_type_id) AS type
FROM sys.parameters AS p
WHERE OBJECT_NAME(p.object_id) = N'add_order'
ORDER BY [schema], p.parameter_id;
The query lists every procedure of that name in the database, in every schema, so a second copy
shows up. Check DB_NAME() too, in case the connection is in a different database from the one you
expect.
Bring the procedure up to date
Run the migration that adds the parameter on this server. When you add a parameter, give it a default so callers that don’t pass it keep working, and deploy the procedure before the code that uses it:
CREATE OR ALTER PROCEDURE dbo.add_order
@customer_id int,
@total decimal(10, 2),
@status varchar(20) = 'new',
@note nvarchar(200) = NULL
AS
INSERT INTO dbo.orders (customer_id, total, status, note)
OUTPUT inserted.id
VALUES (@customer_id, @total, @status, @note);
Name the schema and the parameters
Call dbo.add_order, not add_order, and pass arguments by name (@total = 30.00), so a call
reaches the procedure you mean and a mismatch reports the parameter it’s about (8145 or 201) instead
of a count.
Declare every sp_executesql parameter
EXEC sys.sp_executesql
N'SELECT name FROM dbo.customers WHERE id = @id AND status = @status',
N'@id int, @status varchar(20)',
@id = 1, @status = 'active';
Reproduce it
On SQL Server 2022 (16.0.4295.3) with sqlcmd, a procedure
add_order @customer_id int, @total decimal(10,2), @status varchar(20) = 'new' and a function
order_total (@customer_id int, @status varchar(20) = 'paid') in a scratch schema:
EXEC seo_err_mssql.add_order 1, 5, 'new', 'extra';
EXEC seo_err_mssql.add_order @customer_id = 1, @total = 5, @note = 'x';
SELECT seo_err_mssql.order_total(1, 'paid', 'x');
EXEC sys.sp_executesql N'SELECT name FROM seo_err_mssql.customers WHERE id = @id', N'@id int', 1, 2;
HResult 0x1FD0, Level 16, State 2
Procedure or function add_order has too many arguments specified.
HResult 0x1FD1, Level 16, State 1
@note is not a parameter for procedure add_order.
Msg 8144, Level 16, State 2, Server 7732422b7f56, Line 1
Procedure or function seo_err_mssql.order_total has too many arguments specified.
HResult 0x1FD0, Level 16, State 2
Procedure or function has too many arguments specified.
Caught in TRY … CATCH, the first call showed ERROR_NUMBER() 8144, state 2, procedure
seo_err_mssql.add_order, line 0. The sys.parameters query listed the three parameters of
add_order. SQL Server 2019 and 2025 printed the same messages.
In Inlet
Inlet’s sidebar lists each schema’s procedures and functions with their arguments, read from the
server you’re connected to, so you can compare them with the call. When SQL Server refuses, Inlet
shows its message with SQL Server error 8144, state 2, severity 16 and links to this page.