Exporting data from SQL server 2008 to CSV?

Posted by Hariinakoti under VB.NET on 11/7/2012 | Points: 10 | Views : 3290 | Status : [Member] | Replies : 3
Hi,

I am having a problem that I hope someone will be able to help. I am exporting records from SQL server 2008 using the SSIS wizard to a CSV format, but I keep getting far more records in the output than the number of records existente in the table I am getting the data from.

I have tried everything but no changes.

Thanks & Regards
Hari



Responses

Posted by: Krv on: 11/8/2012 [Member] Starter | Points: 25

Up
0
Down
a. Have you imported the CSV back to new table and checked the row difference?
b. Make sure you have selected the correct database and tables
c. Use SQL query option to fetch required records instead of selecting the table

Thanks,
R.Vasanth
MCTS(SQL Server & BI)
http://bigdatatech.blogspot.com

Hariinakoti, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Seng2hs on: 11/8/2012 [Member] Starter | Points: 25

Up
0
Down
create CSV output from SSMS, you may want to choose a format like Tab delimited

1.Open a new query window.
2.Create your SQL query.
3.Right click in the query window.
4.Choose Query Options...
5.Choose Text under Results.
6.Change the Output format: to Comma delimited.
7.Change the Maximum number of characters displayed in each column to 8000 or an appropriate value.
8.Click OK.
9.Right click in the query window.
10.Choose Results To and Results to File.
11.Execute your query.
12.Choose a file name and location.
13.Click Save.


Hariinakoti, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Megan00 on: 11/9/2012 [Member] Starter | Points: 25

Up
0
Down
Look at this tool, it can export to MS Word, MS Excel, MS Access, PDF, Text, HTML, XML, RTF, DBF, SQL Script, SYLK, CSV, DIF , MS Clipboard format. Besides, this data export component enables you to easily export data from ListView, Command and DataTable components.

http://exportdata.codeplex.com/

Never give up! Smile to the world!
http://excelcsharp.blog.com/

Hariinakoti, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response