Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 570
  • Last Modified:

Converting data types in sql procedure

I have a procedure that receives a variable @comments datatype Text.  The procedure is adding a new workorder and uses @comments to fill a field.  My problem is I need to add this to the @comment variable before it appends to the data table.  'Time In:' + CHAR(13) + 'Time Out:' + CHAR(13) + 'Tech:' +  CHAR(13) + 'Date:'  

I keep getting an error saying the operand "+" can not be used with comment.  I have no access to code behind but I do have access to the data and stored procedure the program uses, thats why I need to get it done in the stored procedure.

1 Solution
Update Table Set Comments = Convert(varchar(max),Comments) +  'Time In:' + CHAR(13) + 'Time Out:' + CHAR(13) + 'Tech:' +  CHAR(13) + 'Date:'
mgmhicksAuthor Commented:
Perfect thanks!

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now