Need to convert Text field to Varchar temporarily so that I can pass to a stored procedure

后端 未结 1 1532
粉色の甜心
粉色の甜心 2021-01-04 07:14

I am using a SQL 2000 database.

I am working with a database in which I cannot change the types on the tables, or the stored procedures. One of the stored procedures

相关标签:
1条回答
  • 2021-01-04 08:05

    Declare the variable of type varchar(8000)

    declare @v varchar(8000)
    SET @v = (SELECT CAST(textcol as varchar(8000)) FROM yourtable WHERE ....)
    

    Obviously it might still be truncated but not at 1 character.

    0 讨论(0)
提交回复
热议问题