Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
2.60/5 (3 votes)
See more:
The error occurs when executing my queries

error like(
SQL
Conversion failed when converting the nvarchar value to data type int.



Can anyone help me
Posted
Updated 19-Jun-18 2:14am
Comments
[no name] 3-Apr-12 10:16am    
How can we help without seeing the query you are using?
AmitGajjar 4-Apr-12 2:41am    
Provide more detail to resolve your issue. use Improve Question link.

Acting entirely blindfolded, your error message is telling you that you are trying to use a character string as if it was an integer. It may appear to the naked eye like you have only integers in that column, but nvarchars can hold spaces, carriage returns, tabs, etc. all of which will cause this error. Seeing the table structure and your query would help to pinpoint the issue.

Good Luck
 
Share this answer
 
Hi try this,

SQL
CAST(@your_param AS nvarchar(15))
 
Share this answer
 
Hi,

Check out whether your column is numeric data.
select ISNUMERIC(ColumnName) from TableName


If it is a non numeric value take action based on your value
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900