Coming soon - Get a detailed view of why an account is flagged as spam!
view details

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.

2
Move cursor to highlight text
Post Body

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:

  1. SELECT TOP 1000 * FROM
  2. Move cursor to start of "SELECT" then highlight to end of row
  3. Send F5
  4. 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.

Author
Account Strength
100%
Account Age
13 years
Verified Email
Yes
Verified Flair
No
Total Karma
48,380
Link Karma
3,048
Comment Karma
45,243
Profile updated: 2 days ago
Posts updated: 10 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
9 years ago