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

  • SEARCH
  • Home
  • 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 7055721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:46:57+00:00 2026-05-28T03:46:57+00:00

One of the table I’m trying to query has a field with type decimal(38,19)

  • 0

One of the table I’m trying to query has a field with type decimal(38,19). I need to convert it to varchar in order for my perl DBI module to handle. How should I write the conversion in SQL to make it work? Specifically, if I run this in SQL Server Management Studio:

select convert(varchar, 19040220000.0000000000000000000)

I get:

Msg 8115, Level 16, State 5, Line 1
Arithmetic overflow error converting numeric to data type varchar.

I tried to round the number first:

select convert(varchar, round(19040220000.0000000000000000000, 0))

but that doesn’t seem to work either (same error message). In fact round() doesn’t seem to have an effect on that number for some reason. What should I do? Thx.

  • 1 1 Answer
  • 0 Views
  • 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-28T03:46:58+00:00Added an answer on May 28, 2026 at 3:46 am

    If you don’t specify a length for your varchar, it defaults to 30 characters in the case of a CONVERT operation.

    That’s not long enough to hold your 38-digit decimal. So give your varchar an appropriate length in the CONVERT statement!!

    Try this:

    select convert(varchar(40), 19040220000.0000000000000000000)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I create one table by using jquery : <div class=productlist style=float:left; id=productlist> <script type=text/javascript
I have one table that has two fields - ID1 and ID2 ID1 can
Lets say I have one table called REVIEWS This table has Reviews that customers
I have one table that has sales records and another table that has additional
I have one table with two queries and I need to sort it with
I have one table in MYSQL It has data like Id Name 1 test
I have one table of items, let's call it ITEMS. Now I need to
I have one table spread across two servers running MySql 4. I need to
I have one table in my Database that has column names: buildNumber , result
I need to copy one table from database A to database B. The challenge

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.