Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

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

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

Yak Posting Veteran

88 Posts

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

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


The Chadinator

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.

Go to Top of Page

Yak Posting Veteran

88 Posts

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


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

Very Important crosS Applying yaK Herder

52326 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
Go to Top of Page
  Previous Topic Topic Next 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.02 seconds. Powered By: Snitz Forums 2000