hi TabAlleman,
i did some more tests using the sql profiler, following are the result:
first time i used parameterized query:
select @s
sql profiler print these information:
exec sp_executesql N'select @s',N'@s nvarchar(max) ',@s=N'aaa....'
seems like the query 'select @s' was not a proper test case.
so i changed the query to:
select * from posts where content = @s
and sql profiler given these information:
exec sp_executesql N'select * from posts where content = @s',N'@s nvarchar(max) ',@s=N'aaa...'
the third time i used a proc which is:
PROCEDURE [dbo].[testproc1] @s1 varchar(4000) AS select datalength(@s1)
and this time sql profiler print following information:
exec testproc1 @s1=N'aaa...'
of course, as you can imagine the result was 4000.
the important is that during each test, i did not specify the parameter type and size. all these case works just fine. so, i may suspect that the instructions on msdnhere was wrong.