Skip to content

Instantly share code, notes, and snippets.

@mattmc3
Created March 29, 2019 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattmc3/7a074f065663ca3a9b6c5919a8783fa9 to your computer and use it in GitHub Desktop.
Save mattmc3/7a074f065663ca3a9b6c5919a8783fa9 to your computer and use it in GitHub Desktop.
AHK - AutoHotKey save MSSQL script execution history
;CTRL+SHIFT+R run a query, but will also copy the script and save it off
;^+r is QWERTY, ^+s is Colemak for ^+r
^+r::
Send, ^c
EnvGet, HomeDir, USERPROFILE
FormatTime, DateString,,yyyyMMdd
FormatTime, TimeString,,hhmmss
FileCreateDir %HomeDir%\Documents\sqlhist\%DateString%
FileAppend, %Clipboard%, %HomeDir%\Documents\sqlhist\%DateString%\%TimeString%.sql
Send, {f5}
Return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment