sql server - AutoHotkey formating SQL with continuation fails -


i'm new autohotkey , have read of documentation i've been able find on hotstrings , continuation, i'm experiencing problems getting working holstering insert short sql query.

i have script in ahk script file:

:* c1:sqlthing:: ( declare @var1 int     ,@var2 varchar(10)     ,@var3 int  set @var1 = xx  set @var2 = 'xx'  select @var1 = col1 tbl1 (nolock) col2 = @var3 ) 

it comes out in sql studio (double tabs , 1 linefeed missing):

declare @var1 int     ,@var2 varchar(10)         ,@var3 int          set @var1 = xx          set @var2 = 'xx'          select @var1 = col1from tbl1 (nolock)         col2 = @var3 

and have no idea why. i've tried using escaped tab instead (`t), result same.

i'm baffled fact line feed preceding 'from' line disappear.

it's because sql studio auto-indents text being typed , autoreplace strings imitate typing.

instead use clipboard:

:* c1:sqlthing:: text= ( declare @var1 int     ,@var2 varchar(10)     ,@var3 int  set @var1 = xx set @var2 = 'xx'  select @var1 = col1 tbl1 (nolock) col2 = @var3 ) pastetext(text) return  pastetext( text ) {     clipsave := clipboardall     clipboard := text     send +{insert}     sleep 20     clipboard := clipsave } 

Comments

Popular posts from this blog

How to show in django cms breadcrumbs full path? -

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -