Skip to content

Instantly share code, notes, and snippets.

@mattmc3 mattmc3/mssql.ahk
Created Mar 29, 2019

Embed
What would you like to do?
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
You can’t perform that action at this time.