Local variables more than 255 Characters

Results 1 to 2 of 2

Thread: Local variables more than 255 Characters

  1. #1
    Nathan Pond Guest

    Default Local variables more than 255 Characters

    I am using MS SQL Server 7.0, writing a stored procedure. And I can&#039t for the life of me figure out how to declare a variable in my sp that can hold a string of more than 255 characters. I have an ntext field in one of my tables that I need to access, but I can&#039t declare a variable as text, or ntext. Anyone have any ideas? If there is no easy way I was thinking about trying some stuff with temp tables, but that&#039s a last resort. Let me know, thanks in advance.<BR><BR>Nathan

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: Local variables more than 255 Characters

    With SQL 7 you can have ultra-long varchars. Here&#039s an example that I tried out and works fine for me:<BR><BR>CREATE PROCEDURE sp_test AS<BR><BR>declare @x varchar(1000)<BR>select @x = &#039hello there&#039<BR>select @x<BR><BR>Does this answer your question?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •