Search code examples
sql-serveroledb

How to replace legacy datatypes in application working via OLEDB?


Microsoft wrote:

The TEXT, NTEXT, and IMAGE data types will be removed in a future version of SQL Server. Avoid using them in new development work, and plan to modify applications that currently use them. Use the varchar(max), nvarchar(max), and varbinary(max) data types instead.

I can replace these types in tables, SPs, but should I modify C++ client code? Or it can work unmodified with the new types?


Solution

  • If the app code simply uses the column values as large value types, no code changes are likely needed. Changes are required if the code uses TEXTPTR, READTEXT, WRITETEXT, etc. (directly or via API method) as these T-SQL elements only operate on the legacy types.