1

Untill now I have never specified the parameters size when calling a procedure with parameters. But suddenly one day i got an error:

String[2]: the Size property has an invalid size of 0.

I have never seen that before, and it only accured in an output param. So my question is when do I need to size a param, because it works fine as an input..

And, About Output and Output/Input. I have a parameter set as:

@HtmlImageType  VARCHAR(30) OUTPUT

But when I look at the table parameters It is classified as Input/Output, and in my C# code it only works with Output.

1 Answer 1

1

But when I look at the table parameters It is classified as Input/Output

That's because you do in fact send in a parameter that can be changed in the procedure and that value persisted to the caller, an out parameter.

So my question is when do I need to size a param, because it works fine as an input

You need to size them at all times because the type is variable, VARCHAR. However, when providing a value as an input the size is inferred. As an out it can't infer that size and so the default is 0.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.