Converting ntext to varchar in SQL Server 2005

后端 未结 1 1382
死守一世寂寞
死守一世寂寞 2021-01-24 05:35

Is it possible to convert from ntext to varchar in SQL Server?

This is the syntax: ALTER TABLE TBL1 ALTER COLUMN email varchar NULL.

This is the error m

相关标签:
1条回答
  • 2021-01-24 06:10

    Are you definitely on SQL Server 2005 - Not 2000?

    I tested the following and couldn't get the same error message as you

    CREATE TABLE TBL1
    (
    email NTEXT NOT NULL
    )
    INSERT INTO TBL1 VALUES (N'ghfhfhgtf') 
    
    
    ALTER TABLE TBL1 ALTER COLUMN email varchar NULL
    /*Error: String or binary data would be truncated.*/
    
    ALTER TABLE TBL1 ALTER COLUMN email nvarchar (max)
    /*Works*/
    
    0 讨论(0)
提交回复
热议问题