You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

SQL Server中快速输入SELECT * FROM的替代方法及Windows自定义快捷键设置

Hey there! I feel your pain—typing SELECT * FROM hundreds of times a day is such a tedious drag. Let’s break down two solid, practical solutions for you: one built right into SQL Server Management Studio (SSMS), and another using Windows tools to create a global shortcut that works anywhere.

1. SQL Server (SSMS) Built-in Alternatives

SSMS has native tools to cut down on repetitive typing, no extra software needed.

Custom Code Snippet with Quick Trigger

You can create a custom code snippet that expands to SELECT * FROM with a short keyword:

  • Open SSMS, press Ctrl+K, Ctrl+B to open the Code Snippets Manager.
  • Navigate to SQL > My Code Snippets (or create a new folder for your custom snippets).
  • Click Import, then create a new file named SelectAllFrom.snippet with this content:
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>Select All From</Title>
      <Shortcut>saf</Shortcut>
      <Description>Inserts SELECT * FROM</Description>
      <Author>Your Name</Author>
      <SnippetTypes>
        <SnippetType>Expansion</SnippetType>
      </SnippetTypes>
    </Header>
    <Snippet>
      <Code Language="SQL">
        <![CDATA[SELECT * FROM ]]>
      </Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>
  • Import the file into SSMS. Now, in the query editor, type saf and press Tab+Tab—it’ll instantly expand to SELECT * FROM.

Direct Keyboard Shortcut in SSMS

If you prefer a one-press shortcut instead of a keyword:

  • Go to Tools > Options > Environment > Keyboard.
  • In the Show commands containing box, search for Edit.InsertText.
  • Click Press shortcut keys, type a combination you want (e.g., Ctrl+Shift+S), then click Assign and OK.
  • From now on, pressing that shortcut in SSMS will paste SELECT * FROM directly into your query.
2. Windows Global Shortcut (Works Everywhere)

If you want this shortcut to work across all apps (not just SSMS), AutoHotkey is a free, lightweight tool that’s perfect for the job.

Step-by-Step Setup:

  1. Install AutoHotkey (you can find it via a quick search—no external links needed).
  2. Right-click your desktop, select New > AutoHotkey Script.
  3. Open the script with Notepad and paste this code:
; Press Ctrl+Alt+S to auto-type SELECT * FROM
^!s::
SendInput, SELECT * FROM 
return
  1. Save the script, then double-click it to run it (it’ll sit quietly in your system tray).
  2. Now, anywhere you need that phrase—SSMS, text editors, even spreadsheets—press Ctrl+Alt+S and it’ll type it for you instantly.

Bonus: Windows Native Text Replacement

If you don’t want to install third-party tools, use Windows’ built-in AutoCorrect:

  • Go to Settings > Time & Language > Typing > Advanced keyboard settings > Typing insights > AutoCorrect.
  • Add a replacement: type saf in the Replace box, and SELECT * FROM in the With box. Now typing saf followed by space/enter will auto-replace it with your desired phrase.

内容的提问来源于stack exchange,提问作者vamshi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 10:09:08