473,396 Members | 1,792 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

saving output from multiple queries

Greetings,

I have what seems a simple problem....
I want to save the output from the following queries in 1 file in
'SQL Query Analyser', but I can only save each 'grid' separately.
I have about 30 queries in total. 'Messages' tells me the number of
rows affected but I need the data.

So can I save all the grids together at the same time in 1 file ?

Thanks
Mike

PRINT 'HEAT 3510'

SELECT f.persfirstname AS First_Name,
f.perslastname AS Last_Name,
a.rsrchqnumber AS Personal_nr,
b.asgtassignmentid AS Contract_nr,
ISNULL(c.tishcode,'') AS TS_Id,
ISNULL(d.tpitpayrollcode,'6900') AS Pay_Code,
d.tpitdaydate AS Payroll_Date,
c.tishactualenddate AS TS_end_date
FROM resources a
INNER join assignments b ON b.asgtrsrcguid = a.rsrcguid
INNER join timesheets c ON c.tishasgtguid = b.asgtguid
INNER join users e ON e.userguid = a.rsrcuserguid
INNER join persons f ON e.userpersguid = f.persguid
LEFT OUTER join timesheetpayrollitems d ON d.tpittishguid =c.tishguid
WHERE a.rsrchqnumber = 80000147
and b.asgtassignmentid = 0000001234
and c.tishactualenddate > '20050614'
and (d.tpitdaydate > '20050614'
or d.tpitdaydate IS null)
order by d.tpitdaydate

SELECT f.persfirstname AS First_Name,
f.perslastname AS Last_Name,
a.rsrchqnumber AS Personal_nr,
b.asgtassignmentid AS Contract_nr,
ISNULL(c.tishcode,'') AS TS_Id,
c.tishactualenddate AS TS_end_date,
g.thisdaydate AS TSH_date
FROM resources a
INNER join assignments b ON b.asgtrsrcguid = a.rsrcguid
INNER join timesheets c ON c.tishasgtguid = b.asgtguid
INNER join users e ON e.userguid = a.rsrcuserguid
INNER join persons f ON e.userpersguid = f.persguid
INNER join timesheethistory g ON g.thistishguid = c.tishguid
WHERE a.rsrchqnumber = 80000147
and b.asgtassignmentid = 0000001234
and c.tishactualenddate > '20050619'
order by g.thisdaydate

PRINT 'HEAT 3213'

Sep 15 '05 #1
3 9796
Try the Query menu: Results to File (or Results to Text).

Simon

Sep 15 '05 #2
You can save it to one file .
there may be a menutitle at sql query analyser
that is named something like "Query"
in there you have the option to select how you want your
result.
there you can select, that you get results in a file.
by starting the queries you will be asked where to save
the file.
Greetings,

I have what seems a simple problem....
I want to save the output from the following queries in 1 file in
'SQL Query Analyser', but I can only save each 'grid' separately.
I have about 30 queries in total. 'Messages' tells me the number of
rows affected but I need the data.

So can I save all the grids together at the same time in 1 file ?

Thanks
Mike

PRINT 'HEAT 3510'

SELECT f.persfirstname AS First_Name,
f.perslastname AS Last_Name,
a.rsrchqnumber AS Personal_nr,
b.asgtassignmentid AS Contract_nr,
ISNULL(c.tishcode,'') AS TS_Id,
ISNULL(d.tpitpayrollcode,'6900') AS Pay_Code,
d.tpitdaydate AS Payroll_Date,
c.tishactualenddate AS TS_end_date
FROM resources a
INNER join assignments b ON b.asgtrsrcguid = a.rsrcguid
INNER join timesheets c ON c.tishasgtguid = b.asgtguid
INNER join users e ON e.userguid = a.rsrcuserguid
INNER join persons f ON e.userpersguid = f.persguid
LEFT OUTER join timesheetpayrollitems d ON d.tpittishguid =c.tishguid
WHERE a.rsrchqnumber = 80000147
and b.asgtassignmentid = 0000001234
and c.tishactualenddate > '20050614'
and (d.tpitdaydate > '20050614'
or d.tpitdaydate IS null)
order by d.tpitdaydate

SELECT f.persfirstname AS First_Name,
f.perslastname AS Last_Name,
a.rsrchqnumber AS Personal_nr,
b.asgtassignmentid AS Contract_nr,
ISNULL(c.tishcode,'') AS TS_Id,
c.tishactualenddate AS TS_end_date,
g.thisdaydate AS TSH_date
FROM resources a
INNER join assignments b ON b.asgtrsrcguid = a.rsrcguid
INNER join timesheets c ON c.tishasgtguid = b.asgtguid
INNER join users e ON e.userguid = a.rsrcuserguid
INNER join persons f ON e.userpersguid = f.persguid
INNER join timesheethistory g ON g.thistishguid = c.tishguid
WHERE a.rsrchqnumber = 80000147
and b.asgtassignmentid = 0000001234
and c.tishactualenddate > '20050619'
order by g.thisdaydate

PRINT 'HEAT 3213'

Sep 15 '05 #3

Simon Hayes schreef:
Try the Query menu: Results to File (or Results to Text).

Simon

purrfect !

Sep 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Geoff Berrow | last post by:
This is puzzling. If I run $sql = "INSERT INTO customer (custid,username,password,title,firstname,lastname,street,towncity,postcode,telno,mobile,email,glasses) VALUES...
0
by: Urko | last post by:
Hello, I want to return multiple queries from a procedure in Oracle, I know that o can do that with REF CURSOR. But I have a problem I have a query that has a while loop and in each iteration a...
0
by: Clint Pachl | last post by:
When executing multiple queries, which return a result set, must mysql_free_result be called after retrieving each result set using mysql_store_result? My concern is that if the result was not...
3
by: Gord | last post by:
I would like to create a summary report from the results of 11 queries (based on 2 tables). All the queries have the same format and return 3 numbers (Count, Current Year Bal, Last Year Bal.)...
4
by: Dave Edwards | last post by:
I understand that I can fill a datagrid with multiple queries, but I cannot figure out how to fill a dataset with the same query but run against multiple SQL servers, the query , table structure...
1
by: mattcatmattcat | last post by:
I have a VB7 aspx file I am creating that requires multiple queries each dependant on the previous queries results. If I run these queries in foxpro, I just run a query then create a cursor with...
8
by: beretta819 | last post by:
Ok, so I apologize in advance for the wordiness of what follows... (I am not looking for someone to make this for me, but to point me in the right direction for the steps I need to take.) I was...
7
by: vaiism | last post by:
I am creating a report that outputs the contact information and details about a water treatment plant, and needs to include information about people who work there. If I tie all the information...
4
by: Akhenaten | last post by:
I am currently using enterprise manager to run multiple queries on a single table in a DB. I refresh these queries every few minutes. Due to the huge number of them I was looking for a better way...
1
by: junkax | last post by:
1. when I export a query, can I specify just for column1 to be exported and not the other columns 2. can I specify some text to be added to top of the output file? something like this: t...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.