SQL Server Stored Procedure with Text Field

H

honcho

Hello,

Does anyone have an example of an SQL Server stored procedure that updates a
record, where one of its field is of type "text"? My procedure is

/*
** Update the client note and production cycle in a Sites record. Set the
** When_submitted field to the current date/time.
*/
CREATE PROCEDURE spSiteNotePCycle
@ID int,
@Client_notes text,
@PCycle char(14)
AS
UPDATE Sites
SET Client_notes=@Client_notes, When_submitted={ fn NOW() }, PCycle=@PCycle
WHERE (ID = @ID)
GO

The procedure executes successfully, and after the update I get the expected
results in the When_submitted and PCycle fields. But I get only an empty
string in Client_notes. Is this because it is of type "text"? Does "text"
in a stored procedure require me to do something different?

Any help will be gratefully appreciated.
 
H

honcho

Yes, there is definitely text in the variable.
No, it does not work with Query Analyzer.
I got the answer from a different group yesterday. Instead of UPDATE, I
need to use UPDATETEXT or WRITETEXT. (These are described in Books Online.)
Thank you for your suggestions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top