I am batching different queries in one SqlCommand stopping the queries batch when I hit the 2100 parameter limit. If my batch has 2100 or 2099 parameters I still get the excepti
The command sent to SQL Server is
exec sp_executesql
N'SELECT P0 = @p0, P1 = @p1, P2 = @p2...',
N'@p0 int,@p1 int,@p2 int...',
@p0=0,@p1=1,@p2=2...
Note that 2 of the parameter slots in the call to sp_executesql
are taken up with the NVARCHAR
strings for query text and the parameter definitions thus "only" leaving 2,098 free for you to use.