varchar to Text

  • Hi

    I am trying to convert varchar to Text datatype.

    Something like this

    Declare @s1 varchar(80)

    SELECT @s1 = (SELECT TOP 1 col1 FROM Table1 WHERE pid = @id)

    SELECT * FROM dbo.fnTest(CAST(@s1 AS TEXT), ',')

    but I get the error Incorrect syntax near '('.

    Any idea as to how I can get around this problem.

    Thanks

  • well, I would guess it's something with the way you are calling your function.

    This works fine...

    declare @var varchar(1000)

    set @Var = 'abceref'

    select cast(@Var as text)

     

     



    A.J.
    DBA with an attitude

  • You cannot use call for a function as a parameter for another function.

    _____________
    Code for TallyGenerator

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

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