Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Upsizing to SQL and nullable fields
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00704288
Message ID:
00705064
Views:
11
>I went through a test run on upsizing our database (VFP7 to SQL2K) and am now starting to go through the error report to check things out.
>
>One thing I noticed a few times is that there was a problem trying to create a primary key constraint on a nullable column in a table. When I look at the structure in VFP, the column in question is not checked off as allowing null values. Yet, when I look at the table design in SQL the column is marked as allowing nulls. With one table it's a character field and in another it's a date field.
>
>What would trigger the upsize wizard to make the column nullable in SQL? Should I be checking somewhere in the RI for this?
>
>Any info would be greatly appreciated.
>
>Laterness,
>Jon

When you upsize you want to avoid allowing nulls. The only places we use them are on FK's that aren't required and dates that aren't required. We create a default for everything else (not required), (0) for bit and numberics and ('') for char and varchar. This will make for the easiest conversion to SQL IMHO.

So, if we have a varchar(50) for lastname and we want it to be required we don't provide a default. This means that 'somevalue' must be stored.

Also, NULL doesn't mean 'nothing' in means UNKNOWN. That is way NULL = NULL returns a NULL. (If standard ANSI null support is turned on, which is the default.)

BOb
Previous
Reply
Map
View

Click here to load this message in the networking platform