Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2003
    Posts
    14

    Question Unanswered: Passing text parameters

    Hello Guys,


    create procedure spsCheckMsg(
    @sTyp as varchar(100),
    @tMsg as text) as
    select @tMsg = md_body from tbl_msgdef where msgname = @sTyp


    Parameters of the type text can be used in stored procedures. So I wanted to get the text data (md_body) by a select statement and pass it to the parameter @tMsg. This code doesn't work. I always get the message "The assignment operation can't have a text datatype as argument" which refers to the select statement.

    Does anyone have a solution for this?

  2. #2
    Join Date
    May 2003
    Location
    UK
    Posts
    220
    Howdy

    If I have understood correctly, try :

    -------------------------------------------------------------
    Create Procedure spsCheckMsg
    (
    @sTyp as varchar(1000),
    @tMsg as varchar(1000)
    )

    AS

    set @tMsg =
    ( select convert(varchar(1000),md_body) from tbl_msgdef where msgname = @sTyp )
    -------------------------------------------------------------

    Cheers,

    SG

Posting Permissions

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