exporting a table with long field names to Access

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • myemail.an@googlemail.com

    exporting a table with long field names to Access

    Hi all,

    I need to export a table from Ms Sql to Access. However, dts import/
    export gives me an error because the field names are too long. Is
    there a quick way to trim the names of all fields to the 64 characters
    allowed by Access? Or is there a better alternative?

    Thanks!
  • Tom van Stiphout

    #2
    Re: exporting a table with long field names to Access

    On Wed, 23 Apr 2008 01:54:24 -0700 (PDT), "myemail.an@goo glemail.com"
    <myemail.an@goo glemail.comwrot e:

    You could create a view that returns the data from that table, and
    alias each column name:
    create view dbo.ExportXyzTa ble as
    select RidiculouslyLon gColumnName1 as ShortCol1,
    RidiculouslyLon gColumnName2 as ShortCol2,
    -- etc.
    from XyzTable

    Then use that view for exporting.

    -Tom.

    >Hi all,
    >
    >I need to export a table from Ms Sql to Access. However, dts import/
    >export gives me an error because the field names are too long. Is
    >there a quick way to trim the names of all fields to the 64 characters
    >allowed by Access? Or is there a better alternative?
    >
    >Thanks!

    Comment

    • sam@invalidpage.com

      #3
      Re: exporting a table with long field names to Access

      On Apr 23, 3:54 am, "myemail...@goo glemail.com"
      <myemail...@goo glemail.comwrot e:
      Hi all,
      >
      I need to export a table from Ms Sql to Access. However, dts import/
      export gives me an error because the field names are too long. Is
      there a quick way to trim the names of all fields to the 64 characters
      allowed by Access? Or is there a better alternative?
      >
      Thanks!
      Ok, first off, someone correct me if I'm wrong, but this should
      work...

      Connect to the SQL server from access (linked tables) through odbc.

      odbc will shorten the file names then copy the data into a new local
      table in access thereby trimming the Column names down to 64 chars.

      Comment

      Working...