Unix Technical Forum

exporting a table with long field names to Access

This is a discussion on exporting a table with long field names to Access within the SQL Server forums, part of the Microsoft SQL Server category; --> Hi all, I need to export a table from Ms Sql to Access. However, dts import/ export gives me ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-24-2008, 07:07 PM
myemail.an@googlemail.com
 
Posts: n/a
Default 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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-24-2008, 07:07 PM
Tom van Stiphout
 
Posts: n/a
Default Re: exporting a table with long field names to Access

On Wed, 23 Apr 2008 01:54:24 -0700 (PDT), "myemail.an@googlemail.com"
<myemail.an@googlemail.com> wrote:

You could create a view that returns the data from that table, and
alias each column name:
create view dbo.ExportXyzTable as
select RidiculouslyLongColumnName1 as ShortCol1,
RidiculouslyLongColumnName2 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!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-24-2008, 07:07 PM
sam@invalidpage.com
 
Posts: n/a
Default Re: exporting a table with long field names to Access

On Apr 23, 3:54*am, "myemail...@googlemail.com"
<myemail...@googlemail.com> wrote:
> 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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:26 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com