|
How to save query result using T-SQL in a csv file in SSMS 2008? Needs to be done programmatically.
Started by Tony_Henrich on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
You could use System.Diagnostics.Process to run the SQLCMD or OSQL or BCP programs to dump out csv.
|
|
Hello all,
I have the following code that executes a query and writes it directly to a string buffer which then dumps it to a CSV file. I will need to write large amount of records (maximum to a million). This works for a million records it takes about...
Started by Tam on
, 8 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
As way of an example....
If you need to call it from Java you can spawn it as a process .
If it is SQL Server, this would be bcp which can take a query string and generate the file directly.
Of whatever database you are using to generate the file .
|
|
I am attempting insert a fairly large amount of data, and I am getting the following error:
Server: Msg 8621, Level 17, State 1, Line 1
Internal Query Processor Error: The query processor ran out of stack space during query optimization.
I have data being...
Started by sherrer on
, 17 posts
by 5 people.
Answer Snippets (Read the full thread at sqlteam):
Thanks again for all your help....
I can't find.
I was trying not to write out a text file although, I don't know of memory on the server, and the memory doesn't do as much as blip when the query is run.
As far as BCP, I can give it a try...
|
Ask your Facebook Friends
|
Hi,
We are migrating the data base from 2005 to 2008; got a question here.
1. When we put the compatibility mode 100 there were osme errors but when we set the compatibility mode 90 applicaitons started working fine. basically we encountered ANSI joins...
Started by ram.marella on
, 5 posts
by 2 people.
Answer Snippets (Read the full thread at sqlteam):
bcp out all of the data into |~| delimited form
4 a dump and restore
Brett
8-)
Hint: Want your questions answered fast? Follow the direction in this link.
And eliminate bad coding practices (like = *)
3.
|
|
When you have a query or stored procedure that needs performance tuning, what are some of the first things you try?
Started by Terrapin on
, 31 posts
by 26 people.
Answer Snippets (Read the full thread at stackoverflow):
The deleted records) Rebuild Indexes Rebuild Tables (bcp data out/in) Dump / Reload the database is going on with the query, make sure that the indexes are being used as efficiently as possible EXPLAIN to find out what is going on....
|
|
I have a query that has approx 20 columns and I would like to export this to an Excel file with the column headers. I thought this would be easy to figure out but no luck! I searched the web and found one suggestion that did not end up working so I am...
Started by Mark Kadlec on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
EXEC sp the currently configured....
Weblogs.sqlteam.com/brettk/archive/2005/04/13/4395.aspx
EDIT:
The example uses BCP, and to get it to work you may have headers) to better understand what BCP does:
-- To allow advanced options to be changed.
|
|
On Wed, 15 Oct 2008 09:23:02 -0700, pensio <pensio@community.nospam
I'm using bcp command to export a sql server table to an excel sheet. I've
created a bcp format file to use with the command. It looks like this :
9.0
5
1 SQLCHAR ...
Started by pensio on
, 5 posts
by 3 people.
Answer Snippets (Read the full thread at omgili):
For example:
bcp://msdn.microsoft.com/en-us/library/ms191516.aspx
bcp dataBaseX.dbo.FileToExport nul -T -N -f c:\bcp.fmt
3 run the command
....
Type by ' , Copying data from a query to the excel sheet could be a
solution also.
|
|
I have a few remote SQL servers that I need to pull a large amount of data from regularly (say 5,000,000 rows per server). This data also needs to be formatted and FTPed to another server. The dial-up portion is fine, I can connect and communicate with...
Started by scottm on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
On the source side: Dump, zip and split the file into smaller portions, upload On the destination side: download, decompress and rejoin the files....
An "out" parameter that allows you to dump the output of an SQL statement to a flat text file.
|
|
I have to run few SQL queries and put the results into a spreadsheet. Since I am on a Spring/Java environment, I was about to run the queries using JDBC, iterate through the ResultSet, and use Jakarta POI to create a simple XLS.
This looks like a very...
Started by binil on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
" Export Data From SQL Server 2005 to Microsoft Excel Datasheet " If you use something other than MS SQL Server 2005, you can still create a query within Excel to any ODBC data source, and write ....
Workbook and dump data into it directly.
|
|
On Mon, 19 Jan 2009 18:12:23 -0500, Rick <rick@invalid.net
We're stuck in the bad old days of SQL 2000 and I've been specifically
asked to use OSQL to write the output of a SQL statement to a text file.
It's a very simple statement --
SELECT...
Started by Rick on
, 3 posts
by 2 people.
Answer Snippets (Read the full thread at omgili):
INTO, and then use bcp to bulk dump
the table??
Make a batch file with your OSQL line something like the one below
osql = 'A'
bcp YourDatabase.dbo....
Use SELECT ...
Before your sql statement?
maybe instead...
NOCOUNT ON;
...
|