[thelist] SQL Server: How Can I Convert VARCHAR to INT?

James Aylard webmaster at equilon-mrc.com
Thu Aug 16 18:41:31 CDT 2001


Joshua,

> Did you actually want to update the table or just make a select that
> returned what you wanted?

    I will need to update the table. Also, your example wouldn't seem to
"rescue" the numeric portion of any field that contains both numeric and
non-numeric data. Unfortunately, the REPLACE function doesn't appear to
accept wildcards, otherwise that looked promising.
    Perhaps Ryan's cursor-heavy approach is the way to go? Unfortunately, I
got a bit lost trying to tailor that to my implementation (sorry, Ryan --
I'm sure it's just me, though). I typically only use SQL enough to extract
data from a database and to put data back into a database, but not much
else.

James Aylard





More information about the thelist mailing list