How to match sql Query following Scenario

Posted by Jayakumars under ASP.NET on 7/5/2013 | Points: 10 | Views : 582 | Status : [Member] [MVP] | Replies : 1

I have both table
table1 id-int
table2 testId-varchar

how to match both column

now i try to modify column testid to int
did not changed here i have data in my table how to match convert int
most urgent

my query this
cast(id as int)=cast(testid as int)

Mark as Answer if its helpful to you
EmailId :


Posted by: Jitendrasoft09 on: 7/5/2013 [Member] [MVP] Starter | Points: 25

Hi Jay,

In the code only testid needs to convert not id, it works as below code, if you are writing in stored procedure, need to use declare keyword to convert.

SELECT * FROM table1 T1 INNER JOIN table2 T2 ON as int);

Refer below link-

Hope you are clear.

Jitendra Kumar
If my post helps you, plz mark as an answer.

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response