I have a nvarchar column BigMacs in table McTable in my MS SQL 2005 database with alfanumeric and numeric values. For example:
- 132
- 432adfad
- sfs54543
- 5256
And now i would like to do something like this:
select Convert(BigMacs, int) from McTable
where IsNumerc(BigMacs) = 1 AND Convert(BigMacs, int) > 6
But when I do this i get a error:
Msg 245, Level 16, State 1, Line 41 Conversion failed when converting the nvarchar value '.' to data type int.
On line select.
How to fix this?