string or binary data would be truncated. the statement has been terminated.

25 March 2015
#SQL

SQLExceptionの備忘録。

以下の様に怒られました。

string or binary data would be truncated. the statement has been terminated.

Google翻訳

文字列またはバイナリデータが切り捨てられます。ステートメントは終了されました。

解法

フィールドの定義よりも大きい値をデータベースに登録しようとしていたみたいです。

nvarchar(50) → nvarchar(100) とかで解決しました。

 

-完-

4423.ch