Quantcast
Channel: mapping of .net framework types to dbtype, the weird string, nvarchar and char
Viewing all articles
Browse latest Browse all 7

Re: mapping of .net framework types to dbtype, the weird string, nvarchar and char

$
0
0

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.  


Viewing all articles
Browse latest Browse all 7

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>