Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export table to excel ?

Status
Not open for further replies.

6291941

Technical User
Sep 23, 2007
4
NO
Hi,


Have a little question regarding exporting data from a database table to an Excel ark.

Is there any SQL statement you can use to do that ? Export att whole table with it´s columns and data.

The columns in the excel ark (A1, B1, C1, D1 etc) are gonna be replaced with the columns in the database table (id, name, city etc)

Or maybe you can choose the columns you wish to export ?

I´m using the Interactive SQL in Sybase.

Best Regards
Magnus
 
Instead of export to excel why don't you import from excel?
Click Data, Import External Data, New Database Query
And select your Sybase ODBC data source
 
Thx PDreyer,

I´m gonna try i right away! By the way ..

If you have an excel ark with columns. Let´s say A1, B1.
A1 is listing article and B1 is listing price. This is a long list. products.xls

A1 B1
Article 1 50
Article 2 40
Article 3 30
etc .. etc..

In Adaptive SQL Server i have two tables.
Article (tbl_article)
Price (tbl_price)

These are linked together with an unique ID called
obj_num

I want to read my excel ark into Adaptive SQL Server and sort out article and price to the right table.

Is this possible ?

Regards
Magnus
 
If I understand correct;
save as a csv file
then use bcp to load the data into the database
 
Hi,

I´ve read some about it, the BCP function. Problem is i´m pretty new at this stuff.

Problem is how to sort out the csv file
ex. import.csv

article1, 50
article2, 30
article3, 35
etc ..

How do I loop this item´s into the database tables ?
Articles to tbl_article and price´s to tbl_price. Do you need a third party application like VB or something to sort this out ?

Import External Data, New Database Query worked just fine! :) .. Thx for that one!

This was pretty cool, I thougt you could use this function the other way around to. First you import the data to excel using Import External Data, New Database Query, then link the tables i use together with my unique ID (obj_num) add item´s and price´s to excel and then update the database in some way.

Regards
Magnus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top