Well I would do the validation in the ASP page (either client or serverside (I like the las) before submitting it to the db.<BR><BR>But if you really want to do it in SQL Server:<BR><BR>IF LEN(LTRIM(RTRIM(theValue))) = 0 <BR> --contains only spaces<BR> (1 trim is probably enough, but OK)<BR><BR>Maybe you could do something with a user defined datatype, but that depends on the rest of your demands to the field.
1. if user interaction is not required after validation -- define your db field as not null and assign it some default value in case the user does submit "".<BR><BR>2. if user interaction is required -- write a trigger that fires on insert/update. if an empty string is submitted for the field that you have defined as not null, return an error message that you can handle through your user interface.
what data type he did not even mention anything about datatype<BR><BR><BR>he jsut asked you to trim it the data and check.<BR><BR><BR>now if you REALLY want to use SQL ONLY to check then you have to use the LEN function. That is all that will be necessary The len function will return 0 if it is a blank string <BR><BR>"" will return 0<BR>" " will also return 0<BR><BR>