May 21, 2009 at 7:16 am
Dear All,
What is the command using for Import and export data from database table using excel file?
For example I have a file contains C:\Excel\ xyz.csv which contains xyz table information.
What is the command for xyz.csv file imported in the database conatins xyz table also what is the command for xyz.csv file exported from database conatins xyz table?
Please advise me for the needful.
Thanks in advance.
Regards
Sumanta Panda
May 21, 2009 at 10:08 am
There are three options: BCP, OpenRowSet, and SSIS(or DTS).
The Import/Export Wizard in SSMS uses SSIS and is a good choice for one time exports or imports. If you need to do this regularly, you should create a package.
I'm having trouble including sample code, but these articles have good examples of importing and exporting using the above tools:
http://www.mssqltips.com/tip.asp?tip=1202
http://www.mssqltips.com/tip.asp?tip=1540
Greg
May 21, 2009 at 9:16 pm
Why not just use "Get External Data" from Excel?
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply