This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
I write SQL code. I want to be able to select the top 1000 rows for a table quickly and easily.
Here is the final result I want:
I start with something like this:
LEFT JOIN dbo.PERSON
I want to execute the following code:
SELECT TOP 1000 * FROM dbo.PERSON
and then return it to the original state afterwards.
My thought is that I would start by manually clicking just before the table. Then, I type the hotkey and hit space. Here are the steps I want it to take:
- SELECT TOP 1000 * FROM
- Move cursor to start of "SELECT" then highlight to end of row
- Send F5
- Undo changes (delete new text)
Here is my current code:
::?Sel::
(
SELECT TOP 1000 * FROM
)
Right now, I click just before the table name and type my hotkey. Then, I highlight the line, execute the code, and then delete the extra text when I'm done.
Any ideas on how I can improve this to do more of what I want? I've thought about highlighting the table name so that it can be saved to the clipboard and the whole thing could be executed all at once, but it became too complicated and buggy.
Subreddit
Post Details
- Posted
- 9 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/AutoHotkey/...