how to assign text field to a variable in stored procedure

  • I want to assing text field value to a text type variable. But procedure does not allow to declare any text, ntext and image datatype variables. Please tell me what to do?

  • Try coverting the text field to (N)VARCHAR (8000) this way the text field will be able to go into the variable

    DECLARE @VAR1 AS VARCHAR(n)

    SET @VAR1 = (SELECT CAST(Textfield AS VARCHAR(n)) FROM dbo.table1)

    Good luck



    Good Hunting!

    AJ Ahrens


    webmaster@kritter.net

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply