SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Unsupported datatype...Help!


Unsupported datatype...Help!

Author
Message
Davebhoy
Davebhoy
SSC Veteran
SSC Veteran (236 reputation)SSC Veteran (236 reputation)SSC Veteran (236 reputation)SSC Veteran (236 reputation)SSC Veteran (236 reputation)SSC Veteran (236 reputation)SSC Veteran (236 reputation)SSC Veteran (236 reputation)

Group: General Forum Members
Points: 236 Visits: 44
Hi there

Hope someone can help me here please..... I have the following view which displays "Unsupported datatype" in the ACGRP2 column. I can the same result with or without the CONVERT function, thanks.

SELECT DISTINCT coa.client, CONVERT(varchar(5), coa.account) AS accelem, relvalue_ACGRP2.rel_value AS ACGRP2
FROM agr.dbo.accounts AS coa INNER JOIN
(SELECT client, attribute_id, rel_attr_id, att_value, CONVERT(varchar(5), att_val_from) AS val_from, CONVERT(varchar(5), att_val_to) AS val_to,
rel_value
FROM agr.dbo.relvalue AS relvalue
WHERE (attribute_id = 'A0') AND (rel_attr_id = 'ZL')) AS relvalue_ACGRP2 ON coa.client = relvalue_ACGRP2.client
WHERE (coa.client = 'L1') AND (CONVERT(varchar(5), coa.account) BETWEEN relvalue_ACGRP2.val_from AND relvalue_ACGRP2.val_to)
ChrisM@Work
ChrisM@Work
SSC-Forever
SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)

Group: General Forum Members
Points: 41991 Visits: 20008
What's returned when you run this:

SELECT DISTINCT rel_value
FROM agr.dbo.relvalue AS relvalue
WHERE (attribute_id = 'A0')
AND (rel_attr_id = 'ZL')
AND rel_value LIKE 'U%'



“Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Exploring Recursive CTEs by Example Dwain Camps
Davebhoy
Davebhoy
SSC Veteran
SSC Veteran (236 reputation)SSC Veteran (236 reputation)SSC Veteran (236 reputation)SSC Veteran (236 reputation)SSC Veteran (236 reputation)SSC Veteran (236 reputation)SSC Veteran (236 reputation)SSC Veteran (236 reputation)

Group: General Forum Members
Points: 236 Visits: 44
Thanks for your reply Chris.

Nothing gets returned using like U%

Thanks

Dave.
ChrisM@Work
ChrisM@Work
SSC-Forever
SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)

Group: General Forum Members
Points: 41991 Visits: 20008
Davebhoy (7/4/2013)
Thanks for your reply Chris.

Nothing gets returned using like U%

Thanks

Dave.


Hi Dave

Please refer to this Connect article which provides an explanation and a temporary fix. The issue appears to be with the view designer.

Cheers

ChrisM

“Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Exploring Recursive CTEs by Example Dwain Camps
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search