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...

Status
Not open for further replies.

Guest_imported

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

Is there any way around this error???

Heres my SQL Statement.
NOTE: data in columns are declared as ntext

declare @variable as sysname

Update [User_table]
set [User_table.Field_name] = (select case @variable
when 'Field_name1' then Field_name1
when 'Field_name2' then Field_name2
when 'Field_name3' then Field_name3
end as Response1
from [System_table]
where System_table.primekey = @primekey)
where User_table.primekey = @primekey and User_table.userid = @Userid

 

Do you set the value of @variable between the Declare statement and the query? Something seems to be missing.

I assume Field_name1, Field_name2 amd Field_name3 are columns in [System_table]. Is this correct?

Based on my assumptions, I came up with this query.

Update User_table
Set Field_name =
Case @variable
when 'Field_name1' then System_table.Field_name1
when 'Field_name2' then System_table.Field_name2
when 'Field_name3' then System_table.Field_name3
End
From User_Table Inner Join System_table
On User_table.primekey=System_table.primekey
Where User_table.primekey = @primekey
And User_table.userid = @Userid
Terry L. Broadbent
faq183-874 contains some tips and ideas for posting questions in these forums. Please review it if you have time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top