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


Implicit conversion from data type ntext to varchar is not allowed. Use the CONVERT function to run...


Implicit conversion from data type ntext to varchar is not allowed. Use the CONVERT function to run this query.

Author
Message
Adam Bean
Adam Bean
SSCertifiable
SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)

Group: General Forum Members
Points: 6728 Visits: 2222
Ok, I'm confused ...

I have a parameter in my report which passes a multi value VARCHAR value to a procedure. The parameter argument is a VARCHAR(4000). It works just fine, and has been working fine. I found a case (based on date range) to as where I'm getting the error "Implicit conversion from data type ntext to varchar is not allowed. Use the CONVERT function to run this query." After tracing the activity, I found that SSRS is sending all my values to the proc with in unicode ('N). As soon as I remove it, works like a champ.

The thing is though, the source data, is VARCHAR, so why is it barking at me saying I'm trying to convert ntext to varchar? If anything, shouldn't it be trying to convert it to nvarchar from varchar?

So my question is, can I remove this from SSRS? If not, any suggestions? I've never seen such a thing ... I simply changed the parameter on the procedure from varchar to nvarchar ... but again, I'd like to know more about this and if I have any better options.

Thanks

---
SQLSlayer
Making SQL do what we want it to do.
Adam Bean
Adam Bean
SSCertifiable
SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)

Group: General Forum Members
Points: 6728 Visits: 2222
Any thoughts on this? I really need to use VARCHAR as I need greater than a 4000 limit ...

Thanks

---
SQLSlayer
Making SQL do what we want it to do.
Adam Bean
Adam Bean
SSCertifiable
SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)

Group: General Forum Members
Points: 6728 Visits: 2222
So after reviewing this again, I think SSRS is converting the data source to ntext because it's so large, and then obviously when passing into the procedure, it blows up.

Even though the source column is VARCHAR in my dataset, I tried adding a cast AS VARCHAR, and I'm still having the same error.

Obviously If I was SQL2005/8 I could use (MAX), but for now I'm stuck. Any thoughts at all would be most appreciated.

---
SQLSlayer
Making SQL do what we want it to do.
amolkulkarni2007
amolkulkarni2007
Grasshopper
Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)

Group: General Forum Members
Points: 11 Visits: 0
I was facing the same problem. But I came with a solution. I dont know whether it is correct or not.

create procedure sp_test
@str varchar(8000)

changed to

create procedure sp_test
@str ntext
as
declare @str1 varchar(8000)
set str1= conver(varchar(8000), @str)

blah blah
Adam Bean
Adam Bean
SSCertifiable
SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)

Group: General Forum Members
Points: 6728 Visits: 2222
Amol, I ended up doing the same thing to resolve this. Never found any other resolution.

Thanks for the feedback.

---
SQLSlayer
Making SQL do what we want it to do.
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