dbTalk Databases Forums  

Excel to SQL using DTS

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Excel to SQL using DTS in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
cowboy
 
Posts: n/a

Default Excel to SQL using DTS - 11-17-2004 , 01:12 PM






The Excel file are like this:
Jan Feb Mar
Cost 1 2 3
Sales 3 5 6
....

The SQL tableA have colunms named cost, Sales,... and Month. It looks I have
to turn the table 90 degree.

Any one has good solution?

Thanks

Reply With Quote
  #2  
Old   
Jack Peacock
 
Posts: n/a

Default Re: Excel to SQL using DTS - 11-17-2004 , 03:15 PM






"cowboy" <cowboy (AT) discussions (DOT) microsoft.com> wrote

Quote:
The Excel file are like this:
Jan Feb Mar
Cost 1 2 3
Sales 3 5 6
...

The SQL tableA have colunms named cost, Sales,... and Month. It looks I
have
to turn the table 90 degree.

Any one has good solution?

This is a classic pivot table. Do a search on cross-tab or pivot on SQL
help for some examples on how to handle it. SQL Analysis Services and MS
Access both have tools for this kind of table. Does the number of columns
increase each month, and what happens for the new year?
Jack Peacock




Reply With Quote
  #3  
Old   
cowboy
 
Posts: n/a

Default Re: Excel to SQL using DTS - 11-18-2004 , 11:15 AM



Only fond one example in BOL and I have no VB installed and can not use it.

Would mind give any further suggestion?

Thanks

"Jack Peacock" wrote:

Quote:
"cowboy" <cowboy (AT) discussions (DOT) microsoft.com> wrote in message
news:A80D64AD-2B3C-46DC-B872-9D312E423EE6 (AT) microsoft (DOT) com...
The Excel file are like this:
Jan Feb Mar
Cost 1 2 3
Sales 3 5 6
...

The SQL tableA have colunms named cost, Sales,... and Month. It looks I
have
to turn the table 90 degree.

Any one has good solution?

This is a classic pivot table. Do a search on cross-tab or pivot on SQL
help for some examples on how to handle it. SQL Analysis Services and MS
Access both have tools for this kind of table. Does the number of columns
increase each month, and what happens for the new year?
Jack Peacock




Reply With Quote
  #4  
Old   
Jack Peacock
 
Posts: n/a

Default Re: Excel to SQL using DTS - 11-18-2004 , 02:46 PM



"cowboy" <cowboy (AT) discussions (DOT) microsoft.com> wrote

Quote:
Only fond one example in BOL and I have no VB installed and can not use
it.

Would mind give any further suggestion?

Do a search for the PivotTable Service in SQL Analysis Services. If you
have Access XP/2003 there are tools to manipulate pivot tables too. I think
your strategy might be to first import the table as is, then use an MDX to
extract the columns into rows, to unpivot into a final destination table.
Not an MDX expert tho, you might try a different newsgroup for that.
Jack Peacock




Reply With Quote
  #5  
Old   
Francesco Anti
 
Posts: n/a

Default Re: Excel to SQL using DTS - 11-19-2004 , 11:32 AM



You can import the Excel file "as is" in an appropriate table, and then use
a "reverse crosstab" query to turn the table 90 degree.
Read this for a reverse crosstab sample
http://groups.google.it/groups?hl=it...3%26rnum%3 D7


"cowboy" <cowboy (AT) discussions (DOT) microsoft.com> wrote

Quote:
Only fond one example in BOL and I have no VB installed and can not use
it.

Would mind give any further suggestion?

Thanks

"Jack Peacock" wrote:

"cowboy" <cowboy (AT) discussions (DOT) microsoft.com> wrote in message
news:A80D64AD-2B3C-46DC-B872-9D312E423EE6 (AT) microsoft (DOT) com...
The Excel file are like this:
Jan Feb Mar
Cost 1 2 3
Sales 3 5 6
...

The SQL tableA have colunms named cost, Sales,... and Month. It looks
I
have
to turn the table 90 degree.

Any one has good solution?

This is a classic pivot table. Do a search on cross-tab or pivot on SQL
help for some examples on how to handle it. SQL Analysis Services and
MS
Access both have tools for this kind of table. Does the number of
columns
increase each month, and what happens for the new year?
Jack Peacock






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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.