Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Server NULL setting
Message
 
 
To
11/02/2010 08:45:15
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01448763
Message ID:
01448766
Views:
51
This message has been marked as a message which has helped to the initial question of the thread.
>Hello,
>
>I am using MSSql 2008, and most of my fields do not use NULL. Now I got into trouble with the error
Cannot insert the value NULL into column 'DELT', table 'Framework.dbo.Globals'; column does not allow nulls. INSERT fails.
>The issue is that I build an insert statement that only includes the fields that are edited. In VFP I used to do the insert without problems, because not nullable fields would simply be blank after APPEND or INSERT.
>I would like to avoid using nullable fields everywhere, and I also would like to avoid specifying all fields in my insert statements. What is the best way to accomplish that?

For varchar fields you may want to specify default values (empty string). Same thing for other fields. In other words, you need to provide default values for all fields.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform