|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
sql view error annoying
i have a view which was working fine and now for some reason... it keeps on giving me this error when i try to run it..
syntax error converting the varchar value '70,157' to a column of data type int. now 70 is a primarykey of a table and even 157.. can someone tell me what this error means ...thanks in advance... sonia.... |
|
#2
|
||||
|
||||
|
Is '70,157' the exact value of the varchar that is being converted to int?
When you store an int, it cannot have commas in it. When you select against an int, it will not have commas returned. 70,157 with a comma is a non-numeric string value when stored as a varchar. You need to remove the comma somehow. Take a look at replace() in books online. Code:
select replace('70,157', ',', '')
Once you pull the comma out, you should get an implicit conversion of a varchar to int. ![]() |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > sql view error annoying |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|