No, what I'm after is the number of characters allowed in the stored
procedure paramater. For example, say I have a stored procedure:
create procedure sp_Proc1
@someparam varchar(30)
as
update tblWhatever set col1=@someparam
From my .net app, I want to find out how many characters I can pass to the
@someparam parameter in sp_Proc1 (30 in this case). If I pass a 60 character
string to this stored procedure, the last 30 characters will be dropped and
no exception will be raised, although one probably should. But since it's
not, I want to check to make sure that the string I want to pass to the
stored procedure is not longer than the stored procedure will accept.
"Mary Chipman [MSFT]" wrote:
> String.Length will give you the number of characters in a string. Is
> that what you were looking for>
>
> --Mary
>
> On Thu, 3 Feb 2005 07:19:06 -0800, "Joe Monnin" <Joe
> (E-Mail Removed)> wrote:
>
> >I have a database that holds large varchar data. The table has a column of
> >type varchar(8000). The stored procedure that is called to add the data to
> >the table also has a paramater of type varchar(8000). The stored procedure
> >is wrapped within a .net web service. I would like the web service to check
> >the length of the data passed to it and throw an exception if the data is
> >greater than 8000 characters long. But I don't want to hard code the 8000
> >byte limit into the web service. .net has MaxValue properties for simple
> >datatypes like int. System.Data.SqlDbType.VarChar.MaxValue does not exist,
> >however. Is there a way to get the maximum length of the VarChar datatype
> >from .net or better yet, the maximum accepted length of a varchar parameter
> >of a particular stored procedure?
>
>