I need to download all data in a table into a text file or an excel spreadsh
eet. What would be the easiest way to do this?DTS would be the easiest way.
In Enterprise Manager, the shortcut is to right click on the table and choos
e export data.|||Hi,
There are 2 options:-
1. DTS (A Graphical interface , you can just by clicking down load the
contents of a table to Text file.
2. BCP OUT (This is command line utility ) ... For more help execute BCP/?
from command prompt.
a. Using query to BCP OUT specific columns
BCP "Select name from dbname..sysusers" QUERYOUT
c:\sysusers.txt -Usa -Ppassword -SServer_name -c
b. BCP OUT entire table
BCP master..sysobjects OUT c:\sysusers.txt -Usa -Ppassword -SServer_name -c
Thanks
Hari
MCDBA
"Ken Dutton" <anonymous@.discussions.microsoft.com> wrote in message
news:00E0DDBA-97BD-4DB0-B582-8D6863E7C6F2@.microsoft.com...
> DTS would be the easiest way.
> In Enterprise Manager, the shortcut is to right click on the table and
choose export data.|||Hi,
I understand that you want to export the Data in a table to an excel work
sheet or a Text file.
You can achieve this by Import Export Wizard.
In the Enterprise Manager, select the Table from which you want to export
the data .
Right click on that table.
Select All Tasks
Select Export Data
Click on Next - On the Welcome Dialog of DTS Import/Export Wizard
You will get a Choose a Source Dialog. It would by default show the current
database. If that's the database from where you want to export the data,
click on Next
You will get a Choose a Destination Dialog
1. To save the data to Excel (2000 or above) worksheet
a. Select Excel 97 -2 000 in the Destination (from the pull down menu)
b. In the File name option, enter the filename for the output file.
Click on Next
You will see a Specify Table Copy or Query Dialog
Select the "Copy Table(s) and view(s) from the source database
Then Click on NExt
You will get a Select Source Tables and Views Dialog
Select the table from which you want to export the data and then click on
Next.
You will get a Save, Schedule and replicate package dialog.
Select "Run Immediately" option
Click on Next
You will get a Completing the DTS Import/Export Wizard dialog.
Click on Finish
This will successfully create an excel file and populate it with the
records from the selected table.
2. To save the data to Text File
a. Select Text File in the destination (from the pull down menu)
b. in the File Name option ,enter the filename for the output file.
Click on Next
You will see a Specify Table Copy or Query Dialog
Select the "Copy Table(s) and view(s) from the source database
Then Click on NExt
You will get a Select Destination File Format dialog
Select the appropriate format (or leave it to default).
You may want to select the option (First Row has Column Names), to include
the column names in the output
Then Click on NExt
You will get a Save, Schedule and replicate package dialog.
Select "Run Immediately" option
Click on Next
You will get a Completing the DTS Import/Export Wizard dialog.
Click on Finish
This will successfully create an excel file and populate it with the
records from the selected table.
HTH
Ashish
This posting is provided "AS IS" with no warranties, and confers no rights.|||How about going into EXCEL and DATA>IMPORT EXTERNAL DATA>IMPORT DATA>NEW SQL
SERVER CONNECTION.
If the goal is to get SQL data into EXCEL, why use BCP or EM?|||Yes, that worked very well
Thanks
Joel
No comments:
Post a Comment