go
use auditdb
go
create table test (phone Varchar(10)null)
go
insert into test Values (9002624142)
insert into test Values ('50012765428')
select top 10 * from test
select *from test WHERE Phone ='50012765428'
select *from test WHERE Phone =9002624142
select *from test WHERE Phone =50012765428
select *from test WHERE Phone ='9002624142'
above works fine when i create in UAT and PROD, and i have same kind of table existing
but when i try to run below on Existing table, i get Error
table ABC-column varchar(10) Null,
Select *from ABC WHERE Phone =50012765428
Msg 8114, Level 16, State 5, Line 7
Error converting data type varchar to numeric.
runs fine for below::
Select *from ABC WHERE Phone ='50012765428'
there are no index, keys, triggers which may block-
kindly please help on how to fix the issue.