February 13, 2006 at 9:37 pm
Hi,
Does anyone know if Query Analyzer stores all the queries that are executed into a history file and if so how do i view the last executed query which i did not save it.
Thanks.
February 14, 2006 at 5:49 am
I might be jumping the gun a bit but I'm pretty sure that you're out of luck. However, if there is such a feature do let me know because I'm forever closing QA windows without saving them.
Good luck retrieving your query.
February 15, 2006 at 4:32 am
I think Toad for SQL Server (60 days freeware trial version from Quest software) includes this feature.
David
If it ain't broke, don't fix it...
February 15, 2006 at 4:50 am
[off-topic]
You can avoid losing unsaved queries by clearing the checkbox "Do not prompt for unsaved files on closure" in the QA options
February 15, 2006 at 5:04 am
Good old Microsoft. They always provide a tick box for any problems you're having. I'm still looking for the tick box in the .Net development environment that tells it to stop being so resource hungry.
Thanks.
February 15, 2006 at 11:09 am
February 15, 2006 at 1:21 pm
The transaction log does not store a log of all queries. It stores the changes that are made to a database. It is also an unreadable entity.
February 15, 2006 at 1:26 pm
FYI
A product called Aqua Data Studio stores out a history of queries.
It works with both Oracle and MS SQL .
I have been working with their demo a little bit ; price is reasonable
February 16, 2006 at 4:37 pm
FYI.
Instead of figuring out how to find the last unsaved executed query in SQL QA, I started using Teradata SQL Assistant tool which can be used against most of the databases and stores all the queries in a history file. The cool thing about this tool is that history file is displayed right in this analyzer in a tabular format and you can just select and also search on whatever previous queries you might have executed.
Thanks to all for your suggestions.
February 28, 2013 at 2:54 am
I was working on a remote machine and while I was away, the machine was restarted. Lost the scripts I had unsaved, or so I thought; and then I came up with this - was a life saver!
SELECT TOP 10
EST.text
FROM sys.dm_exec_query_stats EQS
CROSS APPLY sys.dm_exec_sql_text(eqs.handle) EST
WHERE EST.text LIKE '%text%'
ORDER BY last_execution_time DESC
https://sqlroadie.com/
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply