Define a long variable, its size might exceed 8,000 bytes

Last post 09-10-2008 3:49 AM by Madhivanan. 3 replies.
Page 1 of 1 (4 items)
Active Topics My Discussions Unanswered Sort Posts: Previous Next
  • 09-08-2008 9:20 AM

    Define a long variable, its size might exceed 8,000 bytes

    Hi,

     

    How can I define a long variable?

    But for my case the variable's size might exceed 8,000 bytes.  Please don't use varchar(max) since I am using sql server 2000.

    My original code is

    declare @x Varchar(8000)
          Set @x = ''
          Select @x = @x +DESCR+' '
          from MERCHANDISE
          Where DESCR Like '%'+upper('TV')+'%'

    Can you please give me an example?

  • 09-08-2008 7:36 PM In reply to

    Re: Define a long variable, its size might exceed 8,000 bytes

    In sql 2000 only the option would be using multiple variables of 8000 characters/bytes...

    MohammedU.
    Microsoft SQL Server MVP
    Moderator
    SQL-Server-Performance.com

    All postings are provided “AS IS” with no warranties for accuracy.
  • 09-09-2008 6:41 AM In reply to

    Re: Define a long variable, its size might exceed 8,000 bytes

    It's hard.

    I don't know how many multiple variables will be used.

  • 09-10-2008 3:49 AM In reply to

    Re: Define a long variable, its size might exceed 8,000 bytes

    zhshqzyc:

    It's hard.

    I don't know how many multiple variables will be used.

    What do you want to do with concatenated values?

    Madhivanan

    Failing to plan is Planning to fail
Page 1 of 1 (4 items)
Active Topics   My Discussions    Unanswered Posts


© 2000 - 2007 vDerivatives Limited All Rights Reserved.