Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Manually exporting tables to MS SQL Server
Message
From
03/11/1997 14:27:54
Bob Lucas
The WordWare Agency
Alberta, Canada
 
 
To
31/10/1997 12:24:27
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00055497
Message ID:
00058024
Views:
33
>>>Good point. I look into this. Still doesn't make sense why that would fail but the INSERT INTO for each records doesn't. It said ID cannot be null..well, there are no NULL ID's in my VFP table! A bit strange.
>>>
>>>Thnnk you!
>>>- GM
>>
>>The NULL value error may be coming from SQL Server. It may be saying that you have not supplied a value for that column and it cannot be null. Make sure that the ID column is updateable (If it is a key field of the SQL Server primary key, by default the view marks these fields as not updateable. Make sure that all the fields of your view are updateable)
>
>
>Thanks a lot for the tip... it seems SQL Server thinks empty string are the same as NULL...this could be the problem!!

Actually what happens is when you append a blank record to a view that is based on SQL Server tables, all fields contain null values until some data is put in. If you do not update a field and it cannot have a null value then you will get an error on the save. If your id field is an identiy column then you cannot mark it as updateable. Also, if you have NULL DISPLAY set to blank then you will not see your null values (they look like blanks). Also, if the ID field is not an identity column, and it is not marked as updateable (because it is the key field and by default VFP does not mark this field for updates) then when the save occurs, this field is not in the field list of data being updated and then SQL Server complains because the field cannot be null (since it wasn't supplied, its value is considered to be null).

Does this help?

Bob
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform