DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  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!
    >
    >




Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links