Sunday, March 25, 2012
Exporting data with dynamic fields
I have one Query Builder application where user creates queries and generates output with required fields.Then user can export the same to excel (Using farPointSpread properties)
But if no. of records goes beyond 10K it goes too slow or even user machine hangs up. I want to give proper export facility. Can it be given using DTS?
I tried DTS (.vbs) file. but for random field selection it did not work.DTS package asks for new Transactions to be built for every change in Source table structure. It first creates the table in the destination databse and then exports the data.
If I try modify the VB code generated by the package to match with new Source table it does'nt work.
Can anyone tell me what should I do for export the data dynamically i.e. export the tables with differrent structres?
Thanx in advance.|||You should do a helluvalotta programming. DTS sucks, and I don't believe most people on this forum use it for much more than directly transfering defined recordsets.
Wednesday, March 21, 2012
Exported queries to excel an spreadsheet file
manager to an excel spreadsheet file.
Thanks in advance.Hi
This depends on what you are actully wanting to do!!
If you are using Query Analyser in grid mode then you can select the whole
result set and cut/paste them into excel. Utilities like BCP can create
comma separated files which excel will open, or possibly you could go
through the XML route. DTS can also be used to do this and may be the most
suitable if you wish to automate the process.
Excel files can be created as a linked server and data pumped into them.
John
"kjc" <ksitron@.elp.rr.com> wrote in message
news:QdJsd.75465$g21.19155@.fe1.texas.rr.com...
> Is it possible to export the results of a query using SQL Server query
> manager to an excel spreadsheet file.
>
> Thanks in advance.|||John Bell (jbellnewsposts@.hotmail.com) writes:
> If you are using Query Analyser in grid mode then you can select the whole
> result set and cut/paste them into excel.
And if you want the column headers as well, go with Text mode, and under
Tools->Options change the delimiter to tab. Then run query, cut and paste.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp
Exported queries to excel an spreadsheet file
manager to an excel spreadsheet file.
Thanks in advance.kjc,
If you want to go the automated route, take a look at Gadami:
http://www.kripsoft.com. It emails sql output in excel attachments.
-Krip
Friday, February 24, 2012
export to cvs/excel with comments attached
i'm building a web page to help our support staff run and export their sql queries faster and more easily than going through the sql server manager. i found an article at codeproject [1] that i was able to customize to be more flexible, but i'm not sure how to get it to export the results of a query along with the comments that preceed the query.
for example, i have the following sql file:
-- this query does a certain thing, and the comment can be pretty long at times, depending on how complicated the query isselect *from table where columnid > 100
would anyone be able to tell me how to edit Kolluri's export function to allow for a comment section? alternatively if his way of doing an export is out of date, i'd be interested in a newer way. most importantly, though, i need to be able to export the comments along with query results.
my ultimate goal is to have a drop down list of databases on the server, a list of query files (from a certain consolodated folder) for them to run on the chosen database, a "test query" function, and an export function that exports the comments and results.
[1] http://www.codeproject.com/aspnet/ExportClassLibrary.asp
if i'm going about this all wrong, i don't mind changing directions. :)
what i'm really trying to do is allow our support staff to speed up their query running. currently they have a folder of txt and sql files that they need to run on a certain database (which is different for different support staff). right now they open one of these txt/sql files, open sql studio, copy the query from the txt/sql, paste it into sql studio, run the query, export the results, open the results, and paste the query into the exported results file. rinse and repeat for every txt/sql file in the folder, which is time consuming and ridiculous.
this seems very repetitive and i was hoping to help them out by allowing them to go to a web page, select one or more queries from a list, pick which database they need to connect to, and i'd loop through all those queries and run them with the support staff having to only click one button to start that process. i've got almost every part of this plan working except being able to put the query in comments at the top of the exported file, but if i need to change my entire game plan to allow that, i'm willing. having the query at the top of the exported results is very important, and if i can't get this working, my whole web page is a bust.