Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 703381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:49:30+00:00 2026-05-14T03:49:30+00:00

I have a SQL Server 2000 database with a column of type VARCHAR(255). All

  • 0

I have a SQL Server 2000 database with a column of type VARCHAR(255). All the data is either NULL, or numeric data with up to two points of precision (e.g. ‘11.85’). I tried to run the following T-SQL query but received the error ‘Error converting data type varchar to numeric’

SELECT CAST([MyColumn] AS DECIMAL)
FROM [MyTable];

I tried a more specific cast, which also failed.

SELECT CAST([MyColumn] AS DECIMAL(6,2))
FROM [MyTable];

I also tried the following to see if any data is non-numeric, and the only values returned were NULL.

SELECT ISNUMERIC([MyColumn]), [MyColumn]
FROM [MyTable]
WHERE ISNUMERIC([MyColumn]) = 0;

I tried to convert to other data types, such as FLOAT and MONEY, but only MONEY was successful. So I tried the following:

SELECT CAST(CAST([MyColumn] AS MONEY) AS DECIMAL)
FROM [MyTable];

…which worked just fine. Any ideas why the original query failed? Will there be a problem if I first convert to MONEY and then to DECIMAL?

Thanks!

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T03:49:30+00:00Added an answer on May 14, 2026 at 3:49 am

    It’s likely that this depends on whether the decimal symbol is a comma or a dot. Here are some test queries and their results:

    select CAST('3.6' as decimal) -- 3.60
    select CAST('3,6' as decimal) -- Error converting data type varchar to numeric.
    select CAST('3.6' as money) -- 3.60
    select CAST('3,6' as money) -- 36.00 (!)
    select ISNUMERIC('3.6') -- 1
    select ISNUMERIC('3,6') -- 1
    

    The documentation for ISNUMERIC says :

    ISNUMERIC returns 1 when the input
    expression evaluates to a valid
    integer, floating point number, money
    or decimal type; otherwise it returns
    0

    Both 3.6 and 3,6 can be cast to money, so that’s why isnumeric('3,6') returns 1.

    To resolve this issue, replace the comma’s with dots (or vice versa, if your system uses comma as the decimal symbol):

    select cast(replace('3,6',',','.') as decimal)
    

    Another option is to change the “decimal symbol” in Windows. It’s in Config Panel -> Regional and Language -> Formats -> Additional Settings -> Numbers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 500k
  • Answers 500k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If you are on .NET 3.5 and can't use Parallel… May 16, 2026 at 1:52 pm
  • Editorial Team
    Editorial Team added an answer if this is a component than you won't be able… May 16, 2026 at 1:52 pm
  • Editorial Team
    Editorial Team added an answer Let's say we have a class/struct Category such that public… May 16, 2026 at 1:52 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have at my SQL Server 2000 Database a column with type Image .
We have SQL Server 2000 database with money data type columns and we have
I have a numeric database field (numeric(3) in SQL Server 2000) that allows nulls,
I have a SQL Server 2000 database that will not display the column list
Lets say I have a table in a sql server 2000 database called TransactionType:
I have an SQL Server 2000 db, and I would like to retrieve summary
I have a SQL Server 2008 database with 2 tables. These tables are defined
I've got a strange problem with SQL Server 2000, and I just can't think
I have a very large database I need to diagram. The database is SQL
I have a project that requires me to do development in SQL Server 2005,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.