-
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
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks