I experience unexpected behavior of execution of a stored procedure on SQL Server through Excel ADO. Stored procedure has a string parameter. If parameter of sp is short - up to round 4 milion characters - everything works fine.
Problem starts when string parameter is e.i. 9 milion characters. I have determined that definitely ADO can pierce to SQL server as I capture the parameter by this code in the beginning of sp:
create procedure MyStoredProcedure(@String nvarchar(max))
as
if OBJECT_ID('dbo.temp', 'U') is not null drop table dbo.temp;
select [String]=@String into dbo.temp
However, parameter cannot be processed further in the sp which is called through Excel ADO. Detailed sp might not be important but just in case it is presented on Stackoverflow in answer here. Definitely, sp itself is ok because I can call it from SSMS like this:
declare @String nvarchar(max)
set @String=(select top 1 [String] from dbo.temp);
exec dbo.MyStoredProcedure @String
and the query executes correctly without any limits to parameter size.
Are there any limits to execution of stored procedures through Excel ADO - like parameter length limit, query limit, time limit?