SQL Text Field and Constraints

Hi,

I am trying to put a length constraint on a field of type text however, SQL Management Studio is giving me an error when attempting to do this. Can you explain why and suggest a solution/ alternative.

Thanks
(len([Note])>0)

Open in new window

dfincham28Asked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
for TEXT, you have to use data_length:
(data_length([Note])>0)

Open in new window

0
 
bmatumburaCommented:
Why not specify a NOT NULL attribute on the field's properties?
0
 
bmatumburaCommented:
See attached screen shot:
123.JPG
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
note: in sql 2005 and higher, replace TEXT by VARCHAR(MAX) and you will have less problems.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.