Will BULK INSERT truncate trailing spaces to fit in smaller field?

Posted on 2007-08-09
Last Modified: 2013-11-05
Dear Experts,

I have a three-byte character field I'd like to BULK INSERT into a two-byte character table field.  I'll be massaging the data beforehand such that only the first two bytes in the text file will actually be used, and the third byte will always be blank.  Does anyone know if BULK INSERT will be smart enough to do the load, ignoring the third byte?  (I don't care if it issues a warning...)

Question by:BrianMc1958
    LVL 12

    Expert Comment

    What database server do you use?

    To give you something of an answer in advance, most database servers will truncate your last byte.

    Author Comment

    SQL Server 2000 and 2005.  Is that what you meant?
    LVL 12

    Accepted Solution

    Yes, that was what I meant.

    SQL Server will truncate the data for you, no problem.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Suggested Solutions

    NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
    Outlook Free & Paid Tools
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now