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 7565967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:17:33+00:00 2026-05-30T14:17:33+00:00

I am using a bulk insert to import data from a CSV file. One

  • 0

I am using a bulk insert to import data from a CSV file. One of the fields is a number, and I import it as a DECIMAL(4,3). However, this data file has a few values where the number is “3.2342e-05”. This obviously throws an error since this is a char. How can I convert this number to zero? For my purposes, I plan to consider any number that small as a zero anyway.

I figure that I will be importing the data into a temp table (staging table) first, so that I can clean it up in there, and then I will be inserting it from there into my final table.

SQL Server 2008

EDIT: One thing I am considering is importing the data as a char and then converting the column type, and then using a CASE statement to set anything greater than 1 to a zero. This field should never be greater than 1, which is why I am able to do this.

  • 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-30T14:17:34+00:00Added an answer on May 30, 2026 at 2:17 pm

    This is recognised as float, so you can double CAST via float

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

Sidebar

Related Questions

So i learned how to do a bulk insert using data from one table
I'm doing a bulk insert of a CSV file into SQL Server 2005, using
I'm doing a bulk insert from a fixed width text file using INSERT INTO
I am using following query to bulk insert from one table to another. INSERT
I'm using SqlBulkCopy to bulk insert some records from one table into another table.
I am importing csv to db using bulk insert. It is the comma delimited
I need to import a large CSV file into an SQL server. I'm using
I came across the .import command to do this (bulk insert), but is there
I'm using OPENROWSET(BULK ...) to insert the contents of a file into my table.
Say i am inserting the data into the database using bulk insert that is

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.