Truncated OUTPUT Stored Procedure Values

C

Chris

Hi,

I created the SQL 2005 stored procedure below:

CREATE PROCEDURE [dbo].[STP_val_deliverable_path]
@s_no smallint,
@deliverable_path nvarchar(255) OUTPUT

When I run in ASP.NET 2005 the stored procedure from server explorer I
get the value 'X:\my directory.......'.

When I run the procedure from code:

Dim var_deliverable_path As String

Dim cmm_select As New SqlCommand("STP_val_deliverable_path",
connection)
cmm_select.CommandType = Data.CommandType.StoredProcedure

var_param = New SqlParameter
var_param.ParameterName = "deliverable_path"
var_param.Direction = Data.ParameterDirection.Output
var_param.Value = "C:\"
cmm_select.Parameters.Add(var_param)

cmm_select.Connection.Open()

cmm_select.ExecuteNonQuery()

cmm_select.Connection.Close()

var_deliverable_path =
CType(cmm_select.Parameters("deliverable_path").Value, String)

The var_deliverable_path has the value of 'X' only, not the whole
string.

What could be the problem ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,965
Messages
2,570,148
Members
46,710
Latest member
FredricRen

Latest Threads

Top