Large UNION query trunctates data in DB field


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Large UNION query trunctates data in DB field

  1. #1
    Jason Salas Guest

    Large UNION query trunctates data in DB field

    I ran into errors recently when I tried running a large UNION query (about
    6,900 news articles) in a desktop Access database, that will eventually be
    migrated to SQL Server. I've got two tables, each having the same typed
    fields. I joined then through the following query:

    SELECT ID,Name,Body FROM Table1 UNION SELECT ID,Name,Body FROM Table2;

    The problem was that in the resultant table containing the conjoined
    records, one of the fields (Body, a MEMO field) copies only the first 250
    characters or so, truncating the rest of the data.

    I was thinking this might have something to do with telling Access how to
    type the data when copying it over. Is there a way to explicitly tell a
    query the data type of each field to be used so that the data can be copied
    over properly?

    Thanks!



  2. #2
    Jason Salas Guest

    Re: Large UNION query trunctates data in DB field

    I figured it out...I needed to use UNION ALL


    "Jason Salas" <jason@kuam.com> wrote in message
    news:3f405b69@tnews.web.devx.com...
    > I ran into errors recently when I tried running a large UNION query (about
    > 6,900 news articles) in a desktop Access database, that will eventually be
    > migrated to SQL Server. I've got two tables, each having the same typed
    > fields. I joined then through the following query:
    >
    > SELECT ID,Name,Body FROM Table1 UNION SELECT ID,Name,Body FROM Table2;
    >
    > The problem was that in the resultant table containing the conjoined
    > records, one of the fields (Body, a MEMO field) copies only the first 250
    > characters or so, truncating the rest of the data.
    >
    > I was thinking this might have something to do with telling Access how to
    > type the data when copying it over. Is there a way to explicitly tell a
    > query the data type of each field to be used so that the data can be

    copied
    > over properly?
    >
    > Thanks!
    >
    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center