SQL Function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sean

    SQL Function

    hello everyone,

    I created a function in MSSQL that builds an html coupon based upon the
    coupon ident (more complex than that, but that's not where i'm having
    problems!)

    When the function builds the coupon, it returns the stream as
    VarChar(8000)

    I am calling this function in a sproc that passes in the coupon ident.
    But when I execute this sproc, I get the following error:

    Syntax error converting the varchar value '<html>......"

    What am I doing wrong? Are there problems with the datatypes I"m
    using?

    Thanks in advance for any help on this?

  • Jack Vamvas

    #2
    Re: SQL Function

    Are you calling the function as in : SELECT * dbo.myFunction or some other
    way?
    Could you post the function and the call from the sproc


    ----
    Jack Vamvas
    _______________ _______________ _____
    Receive free SQL tips - www.ciquery.com/sqlserver.htm
    _______________ _______________ _____


    "Sean" <sklosky@genex. com> wrote in message
    news:1146181419 .634940.224110@ u72g2000cwu.goo glegroups.com.. .[color=blue]
    > hello everyone,
    >
    > I created a function in MSSQL that builds an html coupon based upon the
    > coupon ident (more complex than that, but that's not where i'm having
    > problems!)
    >
    > When the function builds the coupon, it returns the stream as
    > VarChar(8000)
    >
    > I am calling this function in a sproc that passes in the coupon ident.
    > But when I execute this sproc, I get the following error:
    >
    > Syntax error converting the varchar value '<html>......"
    >
    > What am I doing wrong? Are there problems with the datatypes I"m
    > using?
    >
    > Thanks in advance for any help on this?
    >[/color]


    Comment

    • Erland Sommarskog

      #3
      Re: SQL Function

      Sean (sklosky@genex. com) writes:[color=blue]
      > I created a function in MSSQL that builds an html coupon based upon the
      > coupon ident (more complex than that, but that's not where i'm having
      > problems!)
      >
      > When the function builds the coupon, it returns the stream as
      > VarChar(8000)
      >
      > I am calling this function in a sproc that passes in the coupon ident.
      > But when I execute this sproc, I get the following error:
      >
      > Syntax error converting the varchar value '<html>......"
      >
      > What am I doing wrong? Are there problems with the datatypes I"m
      > using?[/color]

      Your major error in your post is that you don't include the code that
      you use. I'm sorry, but it is not possible to help you from the description
      you have given. You have apparently messed up the data types somewhere,
      but that's all I can say.


      --
      Erland Sommarskog, SQL Server MVP, esquel@sommarsk og.se

      Books Online for SQL Server 2005 at

      Books Online for SQL Server 2000 at

      Comment

      Working...