NVarChar data type - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

NVarChar data type

lionblionb Posts: 1,688Member ✭✭
Foloowing code works perfectrly in VB.NET. However, when I tried to use it as VBScript with Integration Services, I got Error message [color=Red]'String or binary data would be truncated. The statement has been terminated'[/color]. It is about NVarChar data type (see blue line of code).

SQL Server 2008 Parameter

@Body NVARCHAR(MAX)

[code]
Dim cmdInsert = New SqlClient.SqlCommand("usp_INSERT_UPDATE_ARTICLE_DATA_MIGRATION", insertConn)
cmdInsert.CommandType = CommandType.StoredProcedure

cmdInsert.Parameters.Add("@Title", SqlDbType.VarChar, 4000).Value = "testing"
[color=Blue]cmdInsert.Parameters.Add("@Body", SqlDbType.NVarChar).Value = stringAdd[/color]
cmdInsert.Parameters.Add("@ArticleDate", SqlDbType.DateTime).Value = Now()

cmdInsert.ExecuteNonQuery()

cmdInsert.Dispose()
Any idea how to fix this problem? Again it is about Integration Services VBScript task

Comments

Sign In or Register to comment.