Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Append paramater to end of text datatype in stored prodecure.

Status
Not open for further replies.

JustBarno

Programmer
Jun 21, 2004
46
US
in the following stored procedure, how would I append the @notes param to the end of the column named notes with the datatype of text.

CREATE PROCEDURE PMC_Bro_UpdateBlast
@Fax int,
@Email int,
@CustId varchar(10),
@notes varchar(100)
AS
Update tbl_cust SET fax = @fax, email = @email WHERE idnum = @CustId
GO
 
Code:
CREATE PROCEDURE PMC_Bro_UpdateBlast
@Fax int,
@Email int,
@CustId varchar(10),
@notes varchar(100)
 AS
Update tbl_cust 
SET fax = @fax, 
email = @email 
notes = notes + @notes
WHERE idnum = @CustId 
GO

"Own only what you can carry with you; know language, know countries, know people. Let your memory be your travel bag.
 
Error 403: Invalid operator for data type. Operator equals add, type equals text.

I had already tried that :(
 
Try the & instead of +

"Own only what you can carry with you; know language, know countries, know people. Let your memory be your travel bag.
 

Error 403: Invalid operator for data type. Operator equals boolean AND, type equals text.
 

fixed it by casting the "text" datatype to a varchar.

Hope this helps someone :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top