sửa lỗi này giúp mình với

Ngọc Hân 0 Reputation points
2024-07-09T05:55:00.4833333+00:00

Screenshot 2024-07-09 112903

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,021 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,032 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Erland Sommarskog 112.7K Reputation points
    2024-07-09T08:13:51.6033333+00:00

    The data type text is deprecated and should have been replaced with varchar(MAX) long ago. So the real solution is to say:

    ALTER TABLE tbl ALTER COLUMN textcol varchar(MAX)
    

    If it is not in your powers to change the table definition, you need to make an explicit convert in your code:

    convert(varchar(MAX), text) + nvarcharcol
    

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.