dbTalk Databases Forums  

Management Studio, shortcut for False/True editing the results pane

microsoft.public.sqlserver.tools microsoft.public.sqlserver.tools


Discuss Management Studio, shortcut for False/True editing the results pane in the microsoft.public.sqlserver.tools forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Robert Carnegie
 
Posts: n/a

Default Re: Management Studio, shortcut for False/True editing the resultspane - 11-11-2008 , 11:26 AM






On Nov 10, 5:01*pm, Aaron Bertrand <aaron.bertr... (AT) gmail (DOT) com> wrote:
Quote:
I will agree that this is very annoying and has been a relatively warm topic
since SQL Server 2005 was first put into beta. *Unfortunately it still works
that way in the SQL Server 2008 tools and there isn't much indication that
they're going to fix in in the version after that either (they don't seemto
think anything is broken).

http://connect.microsoft.com/SQL/fee...aspx?FeedbackI...
4

http://connect.microsoft.com/SQL/fee...aspx?FeedbackI...
3

http://connect.microsoft.com/SQL/fee...aspx?FeedbackI...
2

You have some crafty workaround but they seem very cumbersome to me. *I
don't really approve of open table for editing data anyway; maybe you could
make an Access project with linked tables and edit the data there, or write
a quick web or win form front end that translates 0 and 1 correctly, or
simply use proper DML (INSERT/UPDATE) statements in a query window.
Which is not cumbersome at all... I respect your opinion, but the
tool is there to be used, what's wrong with that? ;-) (I suspect you
can answer extensively...)

Actually, since apparently I have to solve this myself (which is what
I wanted to know), the external macro scripting tool isn't cumbersome
in relation to its power. But there's a catch I don't know how to get
around or switch off (please?), with putting it on the toolbar as an
external command or external tool: apparently, running an external
tool prompts Management Studio to save the contents of other project /
query windows, which is likely to be not what I want to have happen,
because of certain script habits. (See this for instance if you set
up Notepad.exe as an external tool.)

Well, one answer to that is to launch my thing from outside Management
Studio, for instance in the Windows XP Quick Launch toolbar next to
the Start menu. Another is to program it the way that AutoHotkey is
designed to be used, waiting for you to type a special key sequence or
some other trigger (say ttt and fff). I feel it's untidy to keep a
script loaded all the time in /case/ I want it, but I don't want to be
perverse. (But I have two going already...) And my Quick Launch
already is too well stocked for the name to be strictly accurate ;-)

Here's the slightly fancy effort: a script in AutoHotkey language that
saves clipboard, then copies the current cell, then changes the copy
to "True" unless it /was/ "True", in which case "False", then pastes
it back. So you run the same program to change NULL or False to True,
and to change True to False. AutoHotkey makes it quite easy to do
sneaky stuff like this, if you can dig the freaky syntax. I believe
it was written by gam3rz. ;-)


; Saved as TrueFalse.ahk
; Copy the current cell in Management Studio Results, toggle True/
False

; Store previous clipboard contents
;
ClipSaved := ClipboardAll
Clipboard :=

; select current field and copy to clipboard
;
Send, ^a^c
ClipWait ; until not empty

; If content is the word "True" then make "False" else make "True"
;
IfEqual, Clipboard, True ; the word "True", not case sensitive
{
Clipboard = False
}
Else
{
Clipboard = True
}

; Paste
;
Send, ^v

; Restore previous clipboard
;
Clipboard := ClipSaved
ClipSaved =


Reply With Quote
  #12  
Old   
Robert Carnegie
 
Posts: n/a

Default Re: Management Studio, shortcut for False/True editing the resultspane - 11-11-2008 , 11:26 AM






On Nov 10, 5:01*pm, Aaron Bertrand <aaron.bertr... (AT) gmail (DOT) com> wrote:
Quote:
I will agree that this is very annoying and has been a relatively warm topic
since SQL Server 2005 was first put into beta. *Unfortunately it still works
that way in the SQL Server 2008 tools and there isn't much indication that
they're going to fix in in the version after that either (they don't seemto
think anything is broken).

http://connect.microsoft.com/SQL/fee...aspx?FeedbackI...
4

http://connect.microsoft.com/SQL/fee...aspx?FeedbackI...
3

http://connect.microsoft.com/SQL/fee...aspx?FeedbackI...
2

You have some crafty workaround but they seem very cumbersome to me. *I
don't really approve of open table for editing data anyway; maybe you could
make an Access project with linked tables and edit the data there, or write
a quick web or win form front end that translates 0 and 1 correctly, or
simply use proper DML (INSERT/UPDATE) statements in a query window.
Which is not cumbersome at all... I respect your opinion, but the
tool is there to be used, what's wrong with that? ;-) (I suspect you
can answer extensively...)

Actually, since apparently I have to solve this myself (which is what
I wanted to know), the external macro scripting tool isn't cumbersome
in relation to its power. But there's a catch I don't know how to get
around or switch off (please?), with putting it on the toolbar as an
external command or external tool: apparently, running an external
tool prompts Management Studio to save the contents of other project /
query windows, which is likely to be not what I want to have happen,
because of certain script habits. (See this for instance if you set
up Notepad.exe as an external tool.)

Well, one answer to that is to launch my thing from outside Management
Studio, for instance in the Windows XP Quick Launch toolbar next to
the Start menu. Another is to program it the way that AutoHotkey is
designed to be used, waiting for you to type a special key sequence or
some other trigger (say ttt and fff). I feel it's untidy to keep a
script loaded all the time in /case/ I want it, but I don't want to be
perverse. (But I have two going already...) And my Quick Launch
already is too well stocked for the name to be strictly accurate ;-)

Here's the slightly fancy effort: a script in AutoHotkey language that
saves clipboard, then copies the current cell, then changes the copy
to "True" unless it /was/ "True", in which case "False", then pastes
it back. So you run the same program to change NULL or False to True,
and to change True to False. AutoHotkey makes it quite easy to do
sneaky stuff like this, if you can dig the freaky syntax. I believe
it was written by gam3rz. ;-)


; Saved as TrueFalse.ahk
; Copy the current cell in Management Studio Results, toggle True/
False

; Store previous clipboard contents
;
ClipSaved := ClipboardAll
Clipboard :=

; select current field and copy to clipboard
;
Send, ^a^c
ClipWait ; until not empty

; If content is the word "True" then make "False" else make "True"
;
IfEqual, Clipboard, True ; the word "True", not case sensitive
{
Clipboard = False
}
Else
{
Clipboard = True
}

; Paste
;
Send, ^v

; Restore previous clipboard
;
Clipboard := ClipSaved
ClipSaved =


Reply With Quote
  #13  
Old   
Robert Carnegie
 
Posts: n/a

Default Re: Management Studio, shortcut for False/True editing the resultspane - 11-11-2008 , 11:26 AM



On Nov 10, 5:01*pm, Aaron Bertrand <aaron.bertr... (AT) gmail (DOT) com> wrote:
Quote:
I will agree that this is very annoying and has been a relatively warm topic
since SQL Server 2005 was first put into beta. *Unfortunately it still works
that way in the SQL Server 2008 tools and there isn't much indication that
they're going to fix in in the version after that either (they don't seemto
think anything is broken).

http://connect.microsoft.com/SQL/fee...aspx?FeedbackI...
4

http://connect.microsoft.com/SQL/fee...aspx?FeedbackI...
3

http://connect.microsoft.com/SQL/fee...aspx?FeedbackI...
2

You have some crafty workaround but they seem very cumbersome to me. *I
don't really approve of open table for editing data anyway; maybe you could
make an Access project with linked tables and edit the data there, or write
a quick web or win form front end that translates 0 and 1 correctly, or
simply use proper DML (INSERT/UPDATE) statements in a query window.
Which is not cumbersome at all... I respect your opinion, but the
tool is there to be used, what's wrong with that? ;-) (I suspect you
can answer extensively...)

Actually, since apparently I have to solve this myself (which is what
I wanted to know), the external macro scripting tool isn't cumbersome
in relation to its power. But there's a catch I don't know how to get
around or switch off (please?), with putting it on the toolbar as an
external command or external tool: apparently, running an external
tool prompts Management Studio to save the contents of other project /
query windows, which is likely to be not what I want to have happen,
because of certain script habits. (See this for instance if you set
up Notepad.exe as an external tool.)

Well, one answer to that is to launch my thing from outside Management
Studio, for instance in the Windows XP Quick Launch toolbar next to
the Start menu. Another is to program it the way that AutoHotkey is
designed to be used, waiting for you to type a special key sequence or
some other trigger (say ttt and fff). I feel it's untidy to keep a
script loaded all the time in /case/ I want it, but I don't want to be
perverse. (But I have two going already...) And my Quick Launch
already is too well stocked for the name to be strictly accurate ;-)

Here's the slightly fancy effort: a script in AutoHotkey language that
saves clipboard, then copies the current cell, then changes the copy
to "True" unless it /was/ "True", in which case "False", then pastes
it back. So you run the same program to change NULL or False to True,
and to change True to False. AutoHotkey makes it quite easy to do
sneaky stuff like this, if you can dig the freaky syntax. I believe
it was written by gam3rz. ;-)


; Saved as TrueFalse.ahk
; Copy the current cell in Management Studio Results, toggle True/
False

; Store previous clipboard contents
;
ClipSaved := ClipboardAll
Clipboard :=

; select current field and copy to clipboard
;
Send, ^a^c
ClipWait ; until not empty

; If content is the word "True" then make "False" else make "True"
;
IfEqual, Clipboard, True ; the word "True", not case sensitive
{
Clipboard = False
}
Else
{
Clipboard = True
}

; Paste
;
Send, ^v

; Restore previous clipboard
;
Clipboard := ClipSaved
ClipSaved =


Reply With Quote
  #14  
Old   
Robert Carnegie
 
Posts: n/a

Default Re: Management Studio, shortcut for False/True editing the resultspane - 11-11-2008 , 11:26 AM



On Nov 10, 5:01*pm, Aaron Bertrand <aaron.bertr... (AT) gmail (DOT) com> wrote:
Quote:
I will agree that this is very annoying and has been a relatively warm topic
since SQL Server 2005 was first put into beta. *Unfortunately it still works
that way in the SQL Server 2008 tools and there isn't much indication that
they're going to fix in in the version after that either (they don't seemto
think anything is broken).

http://connect.microsoft.com/SQL/fee...aspx?FeedbackI...
4

http://connect.microsoft.com/SQL/fee...aspx?FeedbackI...
3

http://connect.microsoft.com/SQL/fee...aspx?FeedbackI...
2

You have some crafty workaround but they seem very cumbersome to me. *I
don't really approve of open table for editing data anyway; maybe you could
make an Access project with linked tables and edit the data there, or write
a quick web or win form front end that translates 0 and 1 correctly, or
simply use proper DML (INSERT/UPDATE) statements in a query window.
Which is not cumbersome at all... I respect your opinion, but the
tool is there to be used, what's wrong with that? ;-) (I suspect you
can answer extensively...)

Actually, since apparently I have to solve this myself (which is what
I wanted to know), the external macro scripting tool isn't cumbersome
in relation to its power. But there's a catch I don't know how to get
around or switch off (please?), with putting it on the toolbar as an
external command or external tool: apparently, running an external
tool prompts Management Studio to save the contents of other project /
query windows, which is likely to be not what I want to have happen,
because of certain script habits. (See this for instance if you set
up Notepad.exe as an external tool.)

Well, one answer to that is to launch my thing from outside Management
Studio, for instance in the Windows XP Quick Launch toolbar next to
the Start menu. Another is to program it the way that AutoHotkey is
designed to be used, waiting for you to type a special key sequence or
some other trigger (say ttt and fff). I feel it's untidy to keep a
script loaded all the time in /case/ I want it, but I don't want to be
perverse. (But I have two going already...) And my Quick Launch
already is too well stocked for the name to be strictly accurate ;-)

Here's the slightly fancy effort: a script in AutoHotkey language that
saves clipboard, then copies the current cell, then changes the copy
to "True" unless it /was/ "True", in which case "False", then pastes
it back. So you run the same program to change NULL or False to True,
and to change True to False. AutoHotkey makes it quite easy to do
sneaky stuff like this, if you can dig the freaky syntax. I believe
it was written by gam3rz. ;-)


; Saved as TrueFalse.ahk
; Copy the current cell in Management Studio Results, toggle True/
False

; Store previous clipboard contents
;
ClipSaved := ClipboardAll
Clipboard :=

; select current field and copy to clipboard
;
Send, ^a^c
ClipWait ; until not empty

; If content is the word "True" then make "False" else make "True"
;
IfEqual, Clipboard, True ; the word "True", not case sensitive
{
Clipboard = False
}
Else
{
Clipboard = True
}

; Paste
;
Send, ^v

; Restore previous clipboard
;
Clipboard := ClipSaved
ClipSaved =


Reply With Quote
  #15  
Old   
Robert Carnegie
 
Posts: n/a

Default Re: Management Studio, shortcut for False/True editing the resultspane - 11-11-2008 , 11:26 AM



On Nov 10, 5:01*pm, Aaron Bertrand <aaron.bertr... (AT) gmail (DOT) com> wrote:
Quote:
I will agree that this is very annoying and has been a relatively warm topic
since SQL Server 2005 was first put into beta. *Unfortunately it still works
that way in the SQL Server 2008 tools and there isn't much indication that
they're going to fix in in the version after that either (they don't seemto
think anything is broken).

http://connect.microsoft.com/SQL/fee...aspx?FeedbackI...
4

http://connect.microsoft.com/SQL/fee...aspx?FeedbackI...
3

http://connect.microsoft.com/SQL/fee...aspx?FeedbackI...
2

You have some crafty workaround but they seem very cumbersome to me. *I
don't really approve of open table for editing data anyway; maybe you could
make an Access project with linked tables and edit the data there, or write
a quick web or win form front end that translates 0 and 1 correctly, or
simply use proper DML (INSERT/UPDATE) statements in a query window.
Which is not cumbersome at all... I respect your opinion, but the
tool is there to be used, what's wrong with that? ;-) (I suspect you
can answer extensively...)

Actually, since apparently I have to solve this myself (which is what
I wanted to know), the external macro scripting tool isn't cumbersome
in relation to its power. But there's a catch I don't know how to get
around or switch off (please?), with putting it on the toolbar as an
external command or external tool: apparently, running an external
tool prompts Management Studio to save the contents of other project /
query windows, which is likely to be not what I want to have happen,
because of certain script habits. (See this for instance if you set
up Notepad.exe as an external tool.)

Well, one answer to that is to launch my thing from outside Management
Studio, for instance in the Windows XP Quick Launch toolbar next to
the Start menu. Another is to program it the way that AutoHotkey is
designed to be used, waiting for you to type a special key sequence or
some other trigger (say ttt and fff). I feel it's untidy to keep a
script loaded all the time in /case/ I want it, but I don't want to be
perverse. (But I have two going already...) And my Quick Launch
already is too well stocked for the name to be strictly accurate ;-)

Here's the slightly fancy effort: a script in AutoHotkey language that
saves clipboard, then copies the current cell, then changes the copy
to "True" unless it /was/ "True", in which case "False", then pastes
it back. So you run the same program to change NULL or False to True,
and to change True to False. AutoHotkey makes it quite easy to do
sneaky stuff like this, if you can dig the freaky syntax. I believe
it was written by gam3rz. ;-)


; Saved as TrueFalse.ahk
; Copy the current cell in Management Studio Results, toggle True/
False

; Store previous clipboard contents
;
ClipSaved := ClipboardAll
Clipboard :=

; select current field and copy to clipboard
;
Send, ^a^c
ClipWait ; until not empty

; If content is the word "True" then make "False" else make "True"
;
IfEqual, Clipboard, True ; the word "True", not case sensitive
{
Clipboard = False
}
Else
{
Clipboard = True
}

; Paste
;
Send, ^v

; Restore previous clipboard
;
Clipboard := ClipSaved
ClipSaved =


Reply With Quote
  #16  
Old   
Robert Carnegie
 
Posts: n/a

Default Re: Management Studio, shortcut for False/True editing the resultspane - 11-11-2008 , 11:26 AM



On Nov 10, 5:01*pm, Aaron Bertrand <aaron.bertr... (AT) gmail (DOT) com> wrote:
Quote:
I will agree that this is very annoying and has been a relatively warm topic
since SQL Server 2005 was first put into beta. *Unfortunately it still works
that way in the SQL Server 2008 tools and there isn't much indication that
they're going to fix in in the version after that either (they don't seemto
think anything is broken).

http://connect.microsoft.com/SQL/fee...aspx?FeedbackI...
4

http://connect.microsoft.com/SQL/fee...aspx?FeedbackI...
3

http://connect.microsoft.com/SQL/fee...aspx?FeedbackI...
2

You have some crafty workaround but they seem very cumbersome to me. *I
don't really approve of open table for editing data anyway; maybe you could
make an Access project with linked tables and edit the data there, or write
a quick web or win form front end that translates 0 and 1 correctly, or
simply use proper DML (INSERT/UPDATE) statements in a query window.
Which is not cumbersome at all... I respect your opinion, but the
tool is there to be used, what's wrong with that? ;-) (I suspect you
can answer extensively...)

Actually, since apparently I have to solve this myself (which is what
I wanted to know), the external macro scripting tool isn't cumbersome
in relation to its power. But there's a catch I don't know how to get
around or switch off (please?), with putting it on the toolbar as an
external command or external tool: apparently, running an external
tool prompts Management Studio to save the contents of other project /
query windows, which is likely to be not what I want to have happen,
because of certain script habits. (See this for instance if you set
up Notepad.exe as an external tool.)

Well, one answer to that is to launch my thing from outside Management
Studio, for instance in the Windows XP Quick Launch toolbar next to
the Start menu. Another is to program it the way that AutoHotkey is
designed to be used, waiting for you to type a special key sequence or
some other trigger (say ttt and fff). I feel it's untidy to keep a
script loaded all the time in /case/ I want it, but I don't want to be
perverse. (But I have two going already...) And my Quick Launch
already is too well stocked for the name to be strictly accurate ;-)

Here's the slightly fancy effort: a script in AutoHotkey language that
saves clipboard, then copies the current cell, then changes the copy
to "True" unless it /was/ "True", in which case "False", then pastes
it back. So you run the same program to change NULL or False to True,
and to change True to False. AutoHotkey makes it quite easy to do
sneaky stuff like this, if you can dig the freaky syntax. I believe
it was written by gam3rz. ;-)


; Saved as TrueFalse.ahk
; Copy the current cell in Management Studio Results, toggle True/
False

; Store previous clipboard contents
;
ClipSaved := ClipboardAll
Clipboard :=

; select current field and copy to clipboard
;
Send, ^a^c
ClipWait ; until not empty

; If content is the word "True" then make "False" else make "True"
;
IfEqual, Clipboard, True ; the word "True", not case sensitive
{
Clipboard = False
}
Else
{
Clipboard = True
}

; Paste
;
Send, ^v

; Restore previous clipboard
;
Clipboard := ClipSaved
ClipSaved =


Reply With Quote
  #17  
Old   
Robert Carnegie
 
Posts: n/a

Default Re: Management Studio, shortcut for False/True editing the resultspane - 11-11-2008 , 11:26 AM



On Nov 10, 5:01*pm, Aaron Bertrand <aaron.bertr... (AT) gmail (DOT) com> wrote:
Quote:
I will agree that this is very annoying and has been a relatively warm topic
since SQL Server 2005 was first put into beta. *Unfortunately it still works
that way in the SQL Server 2008 tools and there isn't much indication that
they're going to fix in in the version after that either (they don't seemto
think anything is broken).

http://connect.microsoft.com/SQL/fee...aspx?FeedbackI...
4

http://connect.microsoft.com/SQL/fee...aspx?FeedbackI...
3

http://connect.microsoft.com/SQL/fee...aspx?FeedbackI...
2

You have some crafty workaround but they seem very cumbersome to me. *I
don't really approve of open table for editing data anyway; maybe you could
make an Access project with linked tables and edit the data there, or write
a quick web or win form front end that translates 0 and 1 correctly, or
simply use proper DML (INSERT/UPDATE) statements in a query window.
Which is not cumbersome at all... I respect your opinion, but the
tool is there to be used, what's wrong with that? ;-) (I suspect you
can answer extensively...)

Actually, since apparently I have to solve this myself (which is what
I wanted to know), the external macro scripting tool isn't cumbersome
in relation to its power. But there's a catch I don't know how to get
around or switch off (please?), with putting it on the toolbar as an
external command or external tool: apparently, running an external
tool prompts Management Studio to save the contents of other project /
query windows, which is likely to be not what I want to have happen,
because of certain script habits. (See this for instance if you set
up Notepad.exe as an external tool.)

Well, one answer to that is to launch my thing from outside Management
Studio, for instance in the Windows XP Quick Launch toolbar next to
the Start menu. Another is to program it the way that AutoHotkey is
designed to be used, waiting for you to type a special key sequence or
some other trigger (say ttt and fff). I feel it's untidy to keep a
script loaded all the time in /case/ I want it, but I don't want to be
perverse. (But I have two going already...) And my Quick Launch
already is too well stocked for the name to be strictly accurate ;-)

Here's the slightly fancy effort: a script in AutoHotkey language that
saves clipboard, then copies the current cell, then changes the copy
to "True" unless it /was/ "True", in which case "False", then pastes
it back. So you run the same program to change NULL or False to True,
and to change True to False. AutoHotkey makes it quite easy to do
sneaky stuff like this, if you can dig the freaky syntax. I believe
it was written by gam3rz. ;-)


; Saved as TrueFalse.ahk
; Copy the current cell in Management Studio Results, toggle True/
False

; Store previous clipboard contents
;
ClipSaved := ClipboardAll
Clipboard :=

; select current field and copy to clipboard
;
Send, ^a^c
ClipWait ; until not empty

; If content is the word "True" then make "False" else make "True"
;
IfEqual, Clipboard, True ; the word "True", not case sensitive
{
Clipboard = False
}
Else
{
Clipboard = True
}

; Paste
;
Send, ^v

; Restore previous clipboard
;
Clipboard := ClipSaved
ClipSaved =


Reply With Quote
  #18  
Old   
Robert Carnegie
 
Posts: n/a

Default Re: Management Studio, shortcut for False/True editing the resultspane - 11-11-2008 , 11:26 AM



On Nov 10, 5:01*pm, Aaron Bertrand <aaron.bertr... (AT) gmail (DOT) com> wrote:
Quote:
I will agree that this is very annoying and has been a relatively warm topic
since SQL Server 2005 was first put into beta. *Unfortunately it still works
that way in the SQL Server 2008 tools and there isn't much indication that
they're going to fix in in the version after that either (they don't seemto
think anything is broken).

http://connect.microsoft.com/SQL/fee...aspx?FeedbackI...
4

http://connect.microsoft.com/SQL/fee...aspx?FeedbackI...
3

http://connect.microsoft.com/SQL/fee...aspx?FeedbackI...
2

You have some crafty workaround but they seem very cumbersome to me. *I
don't really approve of open table for editing data anyway; maybe you could
make an Access project with linked tables and edit the data there, or write
a quick web or win form front end that translates 0 and 1 correctly, or
simply use proper DML (INSERT/UPDATE) statements in a query window.
Which is not cumbersome at all... I respect your opinion, but the
tool is there to be used, what's wrong with that? ;-) (I suspect you
can answer extensively...)

Actually, since apparently I have to solve this myself (which is what
I wanted to know), the external macro scripting tool isn't cumbersome
in relation to its power. But there's a catch I don't know how to get
around or switch off (please?), with putting it on the toolbar as an
external command or external tool: apparently, running an external
tool prompts Management Studio to save the contents of other project /
query windows, which is likely to be not what I want to have happen,
because of certain script habits. (See this for instance if you set
up Notepad.exe as an external tool.)

Well, one answer to that is to launch my thing from outside Management
Studio, for instance in the Windows XP Quick Launch toolbar next to
the Start menu. Another is to program it the way that AutoHotkey is
designed to be used, waiting for you to type a special key sequence or
some other trigger (say ttt and fff). I feel it's untidy to keep a
script loaded all the time in /case/ I want it, but I don't want to be
perverse. (But I have two going already...) And my Quick Launch
already is too well stocked for the name to be strictly accurate ;-)

Here's the slightly fancy effort: a script in AutoHotkey language that
saves clipboard, then copies the current cell, then changes the copy
to "True" unless it /was/ "True", in which case "False", then pastes
it back. So you run the same program to change NULL or False to True,
and to change True to False. AutoHotkey makes it quite easy to do
sneaky stuff like this, if you can dig the freaky syntax. I believe
it was written by gam3rz. ;-)


; Saved as TrueFalse.ahk
; Copy the current cell in Management Studio Results, toggle True/
False

; Store previous clipboard contents
;
ClipSaved := ClipboardAll
Clipboard :=

; select current field and copy to clipboard
;
Send, ^a^c
ClipWait ; until not empty

; If content is the word "True" then make "False" else make "True"
;
IfEqual, Clipboard, True ; the word "True", not case sensitive
{
Clipboard = False
}
Else
{
Clipboard = True
}

; Paste
;
Send, ^v

; Restore previous clipboard
;
Clipboard := ClipSaved
ClipSaved =


Reply With Quote
  #19  
Old   
Robert Carnegie
 
Posts: n/a

Default Re: Management Studio, shortcut for False/True editing the resultspane - 11-11-2008 , 11:26 AM



On Nov 10, 5:01*pm, Aaron Bertrand <aaron.bertr... (AT) gmail (DOT) com> wrote:
Quote:
I will agree that this is very annoying and has been a relatively warm topic
since SQL Server 2005 was first put into beta. *Unfortunately it still works
that way in the SQL Server 2008 tools and there isn't much indication that
they're going to fix in in the version after that either (they don't seemto
think anything is broken).

http://connect.microsoft.com/SQL/fee...aspx?FeedbackI...
4

http://connect.microsoft.com/SQL/fee...aspx?FeedbackI...
3

http://connect.microsoft.com/SQL/fee...aspx?FeedbackI...
2

You have some crafty workaround but they seem very cumbersome to me. *I
don't really approve of open table for editing data anyway; maybe you could
make an Access project with linked tables and edit the data there, or write
a quick web or win form front end that translates 0 and 1 correctly, or
simply use proper DML (INSERT/UPDATE) statements in a query window.
Which is not cumbersome at all... I respect your opinion, but the
tool is there to be used, what's wrong with that? ;-) (I suspect you
can answer extensively...)

Actually, since apparently I have to solve this myself (which is what
I wanted to know), the external macro scripting tool isn't cumbersome
in relation to its power. But there's a catch I don't know how to get
around or switch off (please?), with putting it on the toolbar as an
external command or external tool: apparently, running an external
tool prompts Management Studio to save the contents of other project /
query windows, which is likely to be not what I want to have happen,
because of certain script habits. (See this for instance if you set
up Notepad.exe as an external tool.)

Well, one answer to that is to launch my thing from outside Management
Studio, for instance in the Windows XP Quick Launch toolbar next to
the Start menu. Another is to program it the way that AutoHotkey is
designed to be used, waiting for you to type a special key sequence or
some other trigger (say ttt and fff). I feel it's untidy to keep a
script loaded all the time in /case/ I want it, but I don't want to be
perverse. (But I have two going already...) And my Quick Launch
already is too well stocked for the name to be strictly accurate ;-)

Here's the slightly fancy effort: a script in AutoHotkey language that
saves clipboard, then copies the current cell, then changes the copy
to "True" unless it /was/ "True", in which case "False", then pastes
it back. So you run the same program to change NULL or False to True,
and to change True to False. AutoHotkey makes it quite easy to do
sneaky stuff like this, if you can dig the freaky syntax. I believe
it was written by gam3rz. ;-)


; Saved as TrueFalse.ahk
; Copy the current cell in Management Studio Results, toggle True/
False

; Store previous clipboard contents
;
ClipSaved := ClipboardAll
Clipboard :=

; select current field and copy to clipboard
;
Send, ^a^c
ClipWait ; until not empty

; If content is the word "True" then make "False" else make "True"
;
IfEqual, Clipboard, True ; the word "True", not case sensitive
{
Clipboard = False
}
Else
{
Clipboard = True
}

; Paste
;
Send, ^v

; Restore previous clipboard
;
Clipboard := ClipSaved
ClipSaved =


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.