-
Best practice for required varchars
Using SQLServer I can set fields as required but with the string field it is
still possible to insert an empty string. I can create a check constraint
that checks to make sure the length is greater than zero but this is a
hassle for every required varchar field. Is there some alternative.
Cheers
--
Michael Culley
www.vbdotcom.com
-
Re: Best practice for required varchars
"Michael Culley" <m_culley@hotmail.com> wrote:
>Using SQLServer I can set fields as required but with the string field it
is
>still possible to insert an empty string. I can create a check constraint
>that checks to make sure the length is greater than zero but this is a
>hassle for every required varchar field. Is there some alternative.
>
>Cheers
>--
>Michael Culley
>www.vbdotcom.com
>
>
>
>
one possibility, if you can live with all fields being the same length, is
to create your own user-defined type ( based on varchar() )& bind an appropriate
rule to this type. jy
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|