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

James Aylard webmaster at equilon-mrc.com
Thu Aug 16 12:15:25 CDT 2001


Ryan,

> Yep, SQL is better...

    Hmm. This looks promising. One thing I now realize I made as clear as
mud in my original post was the part about discarding unneeded data. What I
meant (though I didn't clearly state) was that in those fields that contain
non-numeric data, I would still like to keep the numeric portion of the
data; I can discard the non-numeric portion. For instance, say I have the
value "250 PSIG" -- I want to keep the 250, but I can discard the " PSIG"
portion.
    Looks like a job for regular expressions which, afaik, SQL Server
doesn't support. Still thinking from within my little box, is there a
straightforward way to do that, as well?
    Thanks. (And thanks Rudy and Joshua for your feedback, as well.)

James





More information about the thelist mailing list