Re: Text datatype

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Wayne Snyder (wayne.nospam.snyder_at_mariner-usa.com)
Date: 08/18/04


Date: Wed, 18 Aug 2004 06:58:45 -0400

What most people do as a work around is either use multiple varchar columns
as parameters OR create and use a temporary table with a varchar column...
The stored procedure inserts data into the text column in the temp table,
then either selects the data out ( returning a result set with the text
column) , or allowing someone else to select against the table..

-- 
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Stevo" <Stevo@discussions.microsoft.com> wrote in message
news:1C2F23B5-D9C0-42A2-A62C-6768D188102B@microsoft.com...
> I have a stored procedure that as one of its arguments takes a text
datatype.
> I need to call this stored procedure from inside a second stored
procedure.
>
> The problem I have is that the value of the text argument in the first
> stored procedure need to be constructed in the calling stored procedure.
The
> example below is not my actual stored procedure, but it illustrate the
> problem I have.
>
>      CREATE PROCEDURE First
>      @blah text
>      AS
>      --Do something
>      GO
>
>      CREATE PROCEDURE Calling
>      AS
>      DECLARE @thing text
>      SELECT @thing = ''
>      SELECT @thing = @thing + col_varchar FROM Some_Table
>      --col_varchar is a column in table Some_Table of datatype varchar(10)
>      EXEC First @thing
>      GO
>
> This however fails to work as you can not declare a local variable of type
> text. I can not use varchar(8000) as Some_Table will have many more
entries
> than 8000. Is there some workaround whereby I can call 'First' from
'Calling'
> and have the argument '@thing' as the concatenation of a column of a table
> which will certainly exceed 8000 characters?
>
> Thanks in advance


Relevant Pages

  • Re: Checking for return codes
    ... The last generated key in a SQL Server can be found by calling "Select ... In the stored procedure I would like to run a select to ... select in the SQL Server stored procedure to my VB .Net procedure? ...
    (microsoft.public.dotnet.framework.adonet)
  • Disable Server Error Messages to Client App (VB)
    ... Using SQL Server 2000 and VB5, ... calling a stored procedure from VB code. ...
    (microsoft.public.vb.database.ado)
  • asyncron sql server operations
    ... TAdoComman) so that the programm runs after calling a stored procedure in ... sql server, although the sp is not already yet? ...
    (borland.public.delphi.database.ado)
  • Disable Server Error Messages to Client App (VB)
    ... Using SQL Server 2000 and VB5, ... calling a stored procedure from VB code. ...
    (comp.lang.basic.visual.database)
  • Re: How to get list of EventClasses in MSSQLServer2000
    ... statement inside a stored procedure has completed.') ... SQL Server statement or stored procedure.') ... Plan','Displays the plan tree of the Transact-SQL statement executed.') ... Login','Occurs when a SQL Server login is added or removed; ...
    (microsoft.public.sqlserver.security)