Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 123»»»

.csv format from ssms Expand / Collapse
Author
Message
Posted Thursday, August 16, 2012 7:08 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, November 19, 2012 6:56 PM
Points: 104, Visits: 364
Hello

I want to take data extract into .csv format. I already try from select my result set and save as .csv file.
but people complain about that is not in real csv format.

so please suggest me any other way for csv data file dump.

Post #1345922
Posted Thursday, August 16, 2012 7:22 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 11:25 AM
Points: 23,000, Visits: 31,484
Have you tried using the Import/Export wizard?



Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #1345942
Posted Thursday, August 16, 2012 7:24 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, November 19, 2012 6:56 PM
Points: 104, Visits: 364
Lynn Pettis (8/16/2012)
Have you tried using the Import/Export wizard?


No, because i am exporting my results from query
Post #1345944
Posted Thursday, August 16, 2012 7:27 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: 2 days ago @ 8:44 PM
Points: 358, Visits: 901
You can do this. On the screen titled "Specify Table Copy or Query", choose "Write a query to specify the data to transfer". In the next screen, paste your query.
Post #1345949
Posted Thursday, August 16, 2012 7:29 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 6:53 AM
Points: 5,132, Visits: 4,922
You can use the wizard to run a query to export to a flat file.

You can also run the query to file, but to save it as CSV, you would have to put in a ',' in between each column other wise it will export it as one cell, not multiple cells.




Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1345951
Posted Thursday, August 16, 2012 8:06 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, November 19, 2012 6:56 PM
Points: 104, Visits: 364
anthony.green (8/16/2012)
You can use the wizard to run a query to export to a flat file.

You can also run the query to file, but to save it as CSV, you would have to put in a ',' in between each column other wise it will export it as one cell, not multiple cells.


I am using temp table as #temp1 in my query

but export wizard don't allow that
so how to handle that?
Post #1345985
Posted Thursday, August 16, 2012 8:10 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 6:53 AM
Points: 5,132, Visits: 4,922
select column1,',',column2,',',column3 from #temp

then export query results to file using ssms




Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1345989
Posted Thursday, August 16, 2012 8:14 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 11:25 AM
Points: 23,000, Visits: 31,484
Here is the problem we face, we can't see what you see. You are using a temporary table, great. Are you exporting directly from the table using a query? Based on what little you have provided, probably. Well, how is the data getting INTO the temporary table? Are you running a query to populate this table or is the data just magically appearing in the table for you? If you are using a query, use that query in the Import/Export wizard to create your csv file.


Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #1345992
Posted Thursday, August 16, 2012 8:22 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, November 19, 2012 6:56 PM
Points: 104, Visits: 364
Lynn Pettis (8/16/2012)
Here is the problem we face, we can't see what you see. You are using a temporary table, great. Are you exporting directly from the table using a query? Based on what little you have provided, probably. Well, how is the data getting INTO the temporary table? Are you running a query to populate this table or is the data just magically appearing in the table for you? If you are using a query, use that query in the Import/Export wizard to create your csv file.



in my task, i need to load into temp table by year wise and then join to actual table. so i am using temp table
and thats why i having some trouble
Post #1345998
Posted Thursday, August 16, 2012 8:23 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 6:53 AM
Points: 5,132, Visits: 4,922
please provide your query



Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1346000
« Prev Topic | Next Topic »

Add to briefcase 123»»»

Permissions Expand / Collapse