Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Export all table into text file

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-05-03 : 13:08:39
Muhsin writes "Hy,

I want to export all tables of my Microsoft SQL Server into a textfile. With the DTS I have only the possibility to export one table after one table. But I have to much tables to export.

There must be possibility to export all tables together. How can I do this?

Thanks a lot for your help.

sincerely

Muhsin"

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-05-03 : 13:14:09
You can script out bcp statements:

SELECT 'bcp dbname.dbo.' + name + ' out C:\' + name + '.txt -S(local) -T -c'
FROM sysobjects

Then copy the output into a text file and save it as a cmd file. Then double click on the cmd file.

Tara
Go to Top of Page

chicagojaner
Starting Member

1 Post

Posted - 2004-05-11 : 06:09:19
First thanks tduggan. But I want to export the contents and the structure of my tables.

I tried yesterdey yours:

quote:
SELECT 'bcp dbname.dbo.' + name + ' out C:\' + name + '.txt -S(local) -T -c'
FROM sysobjects

But I want to export the structure too.

chicagojaner
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-05-11 : 12:16:50
Is BACKUP/RESTORE an option? This will grab everything.

You can generate the table structure using the generate SQL script in Enteprise Manager. Do that first, then run the script on the destination server, then bcp the data.

Tara
Go to Top of Page
   

- Advertisement -