TT (Mk1) Discussion Discussion forum for the Mk1 Audi TT Coupe & Roadster produced from 2000-2006

SQL Server help, Error 279: The text, ntext, and image..

Thread Tools
 
Search this Thread
 
Old 08-02-2001, 12:04 PM
  #1  
Member
Thread Starter
 
Respect the Cock's Avatar
 
Join Date: Jun 2001
Posts: 2,058
Likes: 0
Received 0 Likes on 0 Posts
Default SQL Server help, Error 279: The text, ntext, and image..

data types are invalid in this subquery or aggregate function.

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
Old 08-02-2001, 12:08 PM
  #2  
Elder Member
 
Rennen's Avatar
 
Join Date: Aug 2000
Posts: 13,790
Likes: 0
Received 0 Likes on 0 Posts
Default

Just when you think we have reached the pinacle of OT posts here....
Old 08-02-2001, 12:16 PM
  #3  
Senior Member
 
D.Ross's Avatar
 
Join Date: Jun 2000
Posts: 7,903
Likes: 0
Received 0 Likes on 0 Posts
Default I don't think so... it's common among rdbs not to allow agg. functions or subquerys

on large fields, ie ntext image etc...

Think about it, ntext can be up to 16gb in length I think, imagine what that would do when putting into a variable.
Old 08-02-2001, 12:44 PM
  #4  
New Member
 
DavesTT's Avatar
 
Join Date: Feb 2001
Posts: 414
Likes: 0
Received 0 Likes on 0 Posts
Default He is correct, such large datatypes are not allowed to be used in aggregates.

I got into the same problem using TEXT. You might be able to convert, but I dont remember.

Nice to see a fellow DB'r on the board ;-) Good luck.
Old 08-02-2001, 01:03 PM
  #5  
AudiWorld Super User
 
David_TT225QC's Avatar
 
Join Date: Nov 2000
Posts: 17,618
Likes: 0
Received 0 Likes on 0 Posts
Default subquery rules

From MS SQL Server BOL:

Subquery Rules
A subquery is subject to a number of restrictions:

The select list of a subquery introduced with a comparison operator can include only one expression or column name (except that EXISTS and IN operate on SELECT * or a list, respectively).


If the WHERE clause of an outer query includes a column name, it must be join-compatible with the column in the subquery select list.


The ntext, text and image data types are not allowed in the select list of subqueries.


Because they must return a single value, subqueries introduced by an unmodified comparison operator (one not followed by the keyword ANY or ALL) cannot include GROUP BY and HAVING clauses.


The DISTINCT keyword cannot be used with subqueries that include GROUP BY.


The COMPUTE and INTO clauses cannot be specified.


ORDER BY can only be specified if TOP is also specified.


A view created with a subquery cannot be updated.


The select list of a subquery introduced with EXISTS by convention consists of an asterisk (*) instead of a single column name. The rules for a subquery introduced with EXISTS are identical to those for a standard select list because a subquery introduced with EXISTS constitutes an existence test and returns TRUE or FALSE, rather than data.
Old 08-02-2001, 01:46 PM
  #6  
AudiWorld Super User
 
TTom TTR's Avatar
 
Join Date: Mar 2000
Location: Wake Forest, NC USA
Posts: 3,593
Received 49 Likes on 35 Posts
Default

I like your sig. beauty.
Old 08-02-2001, 04:08 PM
  #7  
Senior Member
 
D.Ross's Avatar
 
Join Date: Jun 2000
Posts: 7,903
Likes: 0
Received 0 Likes on 0 Posts
Default

thx
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
HatchODoom
Audi allroad
22
05-16-2013 07:40 PM
Dclueless1
Audi A5 / S5 / RS5 Coupe & Cabrio (B8)
7
06-03-2010 03:46 PM
bpp
S4 (B6 & B7 Platforms) Discussion
0
05-11-2006 03:24 PM
Silver S4
S4 / RS4 (B5 Platform) Discussion
1
07-21-2000 09:39 AM



Quick Reply: SQL Server help, Error 279: The text, ntext, and image..



All times are GMT -8. The time now is 01:36 PM.