SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 convert varchar
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

kt
Yak Posting Veteran

75 Posts

Posted - 04/01/2013 :  18:17:21  Show Profile  Reply with Quote
Hi,

why am i still getting error message for"Conversion failed when converting the varchar value 'SM485695' to data type int.

select *
from dbo.tbl1 as t1
left join dbo.tbl2 as t2
on convert(varchar(50),t1.saleNo) = t2.saleNo

Thanks

chadmat
The Chadinator

USA
1974 Posts

Posted - 04/01/2013 :  18:44:11  Show Profile  Visit chadmat's Homepage  Reply with Quote
Because SM485695 can't be converted to an INT.

-Chad
Go to Top of Page

kt
Yak Posting Veteran

75 Posts

Posted - 04/01/2013 :  18:55:53  Show Profile  Reply with Quote
what should i do?

thx

Edited by - kt on 04/01/2013 22:58:16
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52309 Posts

Posted - 04/02/2013 :  01:25:25  Show Profile  Reply with Quote
avoid implicit/explicit conversion to int. Check for any such instances in your code and cast int values to varchar explicitly in those places.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.17 seconds. Powered By: Snitz Forums 2000