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
 General SQL Server Forums
 New to SQL Server Programming
 Export/ Import

Author  Topic 

shajimanjeri
Posting Yak Master

179 Posts

Posted - 2007-01-10 : 05:04:05

How to export records from sql server 2005 database to a notepad or to excel..?
and how to import records from SQL server 2005 to SQL server 2000.

pls anyboy can help me pls

with regards
shaji

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-01-10 : 05:05:48
You can export records with BCP command.
And you can insert them with bulk insert command.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

shajimanjeri
Posting Yak Master

179 Posts

Posted - 2007-01-10 : 05:09:11

How to export it with BCP, bulk insert.
I am completely new to sql...

regards
shaji

quote:
Originally posted by Peso

You can export records with BCP command.
And you can insert them with bulk insert command.


Peter Larsson
Helsingborg, Sweden

Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-01-10 : 05:12:20
To get the table's values to a file
bcp "SELECT au_fname, au_lname FROM pubs..authors ORDER BY au_lname" queryout Authors.txt -c -Sservername -Usa -Ppassword

The BCP command is run from Windows Command Prompt

To get the file's values to a table
BULK INSERT Northwind.dbo.[Order Details] FROM 'f:\orders\lineitem.tbl'


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-01-10 : 05:46:47
Also take a look here
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=77326


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -