Hi-
I've noticed that I have gotten in the habit of using nvarchar(max) as the datatype for almost all of my string-type arguments when defining stored procedures. I'm curious if anybody has any thoughts on if this is a good or a bad practice?
So, is it better to say "create procedure foo(@.bar nvarchar(50) ..." or "create procedure foo(@.bar nvarchar(max) ..."?
Thanks,
-Eric.
It is recommended that you should use nvarchar(max) instead of nvarchar(n) when the size of column data might exceed 8000 bytes.
There is no difference in the behavior of varchar(n) and varchar(max). As a good practice, varchar(max) should be used as a substitute for text datatype and not of varchar(n).
No comments:
Post a Comment