FoxPro Programming
text vs varchar
Gravatar is a globally recognized avatar based on your email address. text vs varchar
  Stein Goering
  All
  May 5, 2023 @ 06:15am

We offer our customers a path to upsize from VFP data to SQL Server. When doing so, we have always mapped memo fields to the SQL text type, but it appears that the use of text is falling out of favor, with the recommendation being to use varchar(max) instead.

Of course, what's optimal for general SQL use may not always apply to us as Fox developers, since we need to worry about things like ODBC compatibility. Anyone have experience using varchar(max) fields with VFP front ends?

I see that the Westwind.sql script that generates the WC system tables still uses text fields.

--sg

Gravatar is a globally recognized avatar based on your email address. re: text vs varchar
  Rick Strahl
  Stein Goering
  May 5, 2023 @ 02:50pm

Web Connection uses text because it works most reliably with FoxPro regardless of ODBC driver.

As you point out varchar(max) requires specific versions of the ODBC driver. Also if you're using Text Indexing for searching you have to use text rather than varchar(max).

I don't see a problem with text - it's not going away and even if it does you can always use an older database type to get the compatibility. If necessary you can always switch - it's not like you can't switch text to varchar(max) later.

+++ Rick ---

© 1996-2024