Re: VARCHAR to INT

From: Sanka (Sanka_at_discussions.microsoft.com)
Date: 07/06/04


Date: Tue, 6 Jul 2004 10:08:01 -0700

ISNumeric function allows float, decimal numbers also... which is not acceptable in my system...

The others two suggestions were helpful..
Thanks all for the immediate resposes...

Cheers,
Sanka

"Wayne Snyder" wrote:

> You might also take a look at the isnumeric function..
>
>
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> www.mariner-usa.com
> (Please respond only to the newsgroups.)
>
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
>
> "Sanka" <Sanka@discussions.microsoft.com> wrote in message
> news:752D4D77-A7B6-44EF-951F-274AB2EB85DB@microsoft.com...
> > Hi All,
> >
> > I have a table A with column C whose datatype is varchar(15) ,it contains
> in different values like 1234,abc12,N/A,123455667788 etc etc.
> >
> > Now I need to copy this data into table B with column D whose datatype is
> integer ,Now I need to pull only data which is a valid int.
> > For ex: only 1234 is valid integer in the above list
> >
> > Source Target
> > 1234 1234
> > abc12 NULL
> > N/A NULL
> > 123456789876 NULL
> >
> > Any Ideas...
> >
> > Cheers,
> > Sanka
>
>
>



Relevant Pages

  • Re: Time range matching
    ... > datetime with a time range that spans multiple days... ... > Wayne Snyder, MCDBA, SQL Server MVP ... > community of SQL Server professionals. ...
    (microsoft.public.sqlserver.server)
  • Re: Add new column to a replicated table..
    ... "Wayne Snyder" wrote in message ... > Sp adds the column to the table, and fixes replication... ... > Wayne Snyder, MCDBA, SQL Server MVP ... > community of SQL Server professionals. ...
    (microsoft.public.sqlserver.programming)
  • Re: How to know the table size in sql database and how to know whi
    ... each table during the iteration that happens within the stored procedure. ... > Wayne Snyder, MCDBA, SQL Server MVP ... > community of SQL Server professionals. ...
    (microsoft.public.sqlserver.server)
  • Re: How to learn .Net
    ... > Wayne Snyder, MCDBA, SQL Server MVP ... > Mariner, Charlotte, NC ... >> I read everywhere at the moment that SQL Server professionals need to ...
    (microsoft.public.sqlserver.server)
  • Re: consolidating two data files into one.
    ... > then alter database prod drop file file2 ... > Wayne Snyder, MCDBA, SQL Server MVP ... > community of SQL Server professionals. ...
    (microsoft.public.sqlserver.server)

Loading