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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error 279: The text, ntext, and image data types are invalid in...

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
this subquery or aggregate expression.

the columns in System_LeadTheFieldResponses are defined as ntext.
Here's the code


CREATE PROCEDURE [dbo].[sp_System_FindLeadTheFieldResponses]
@Chapter int,
@Response1 ntext,
@Response2 ntext,
@SessionID nvarchar(500),
@UpdateTable nvarchar(500)='false'
AS

if @UpdateTable = 'false'
begin
insert into Users_LeadTheFieldUserResponses(SessionID, ChapterNumber, ChapterTitle, Question1, Response1, Question2, Response2, UpsellTwo)
select @SessionID, @Chapter, ChapterTitle, Question1, @Response1, Question2, @Response2, UpsellTwo
from System_LeadTheFieldResponses
where Chapter = @Chapter
end


if @UpdateTable = 'true'
begin

begin
update Users_LeadTheFieldUserResponses
set Response1 = (select @Response1 from System_LeadTheFieldResponses where ChapterNumber = @Chapter )
where ChapterNumber = @Chapter and SessionID = @SessionID
end

begin
update Users_LeadTheFieldUserResponses
set Response2 = (select @Response2 from System_LeadTheFieldResponses where ChapterNumber = @Chapter )
where ChapterNumber = @Chapter and SessionID = @SessionID
end

end
GO
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top