|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Show Execution Plan by Default?I've entered a phase on this project where everything is about performance.
I have spent several days now in QA looking at query plans, index statistics and so forth. It would be cool if there were a way for me to booger QA into always having the "Show Execution Plan" always turned on. Or am I just out of luck? -- Peace & happy computing, Mike Labosh, MCSD "Working here is like living inside a Salvador Dali painting." -- Me. Yeah, ME! [Oh fer cryin out loud] Create a template file with the following at the top:
SET STATISTICS IO ON SET STATISTICS TIME ON SET STATISTICS PROFILE ON A Show quote "Mike Labosh" <mlab***@hotmail.com> wrote in message news:OB8eam%23gFHA.3544@TK2MSFTNGP15.phx.gbl... > I've entered a phase on this project where everything is about > performance. > > I have spent several days now in QA looking at query plans, index > statistics and so forth. > > It would be cool if there were a way for me to booger QA into always > having the "Show Execution Plan" always turned on. Or am I just out of > luck? > > -- > Peace & happy computing, > > Mike Labosh, MCSD > "Working here is like living inside a Salvador Dali painting." -- Me. > Yeah, ME! [Oh fer cryin out loud] > > SET STATISTICS IO ON Ack no! I want the graphical pretty query plan not the text-based one.> SET STATISTICS TIME ON > SET STATISTICS PROFILE ON -- Peace & happy computing, Mike Labosh, MCSD "Working here is like living inside a Salvador Dali painting." -- Me. Yeah, ME! [Oh fer cryin out loud] There isn't an option. But nothing is stopping you from writing a quick vbs
to wShell.Run("isqlw -S<server> -U<user> -P<pwd>") then wShell.Sendkeys "^K" -- Show quote-oj "Mike Labosh" <mlab***@hotmail.com> wrote in message news:%23kasUS$gFHA.3164@TK2MSFTNGP15.phx.gbl... >> SET STATISTICS IO ON >> SET STATISTICS TIME ON >> SET STATISTICS PROFILE ON > > Ack no! I want the graphical pretty query plan not the text-based one. > -- > Peace & happy computing, > > Mike Labosh, MCSD > "Working here is like living inside a Salvador Dali painting." -- Me. > Yeah, ME! [Oh fer cryin out loud] > Were you able to get this to work? I thought I'd give it a try for
grins. But I can't seem to send any CTRL characters through WScript. Here is my test script. Watch for wrapping. Option Explicit Dim objShell Set objShell = CreateObject("WScript.Shell") objShell.Run("""C:\Program Files\Microsoft SQL Server\80\Tools\Binn\isqlw"" -Slocalhost -E") objShell.AppActivate "SQL Query Analyzer" Wscript.Sleep 1000 objShell.Sendkeys "select count{(}*{)} from syscomments~" Wscript.Sleep 500 objShell.Sendkeys "-- Sending CTRL K~" Wscript.Sleep 100 objShell.Sendkeys "^K" Wscript.Sleep 500 objShell.Sendkeys "-- Sending CTRL L~" Wscript.Sleep 100 objShell.Sendkeys "^L" Wscript.Sleep 500 objShell.Sendkeys "-- Sending CTRL E~" Wscript.Sleep 100 objShell.Sendkeys "^E" Wscript.Sleep 500 objShell.Sendkeys "-- Sending F5~" Wscript.Sleep 100 objShell.Sendkeys "{F5}" Set objShell = nothing WScript.Quit oj said the following on 7/9/2005 2:44 AM: Show quote > There isn't an option. But nothing is stopping you from writing a quick vbs > to wShell.Run("isqlw -S<server> -U<user> -P<pwd>") then wShell.Sendkeys "^K" > > It works just fine. Try this.
Option Explicit Dim objShell Set objShell = CreateObject("WScript.Shell") objShell.Run("isqlw -Slocalhost -E") objShell.AppActivate "SQL Query Analyzer" Wscript.Sleep 1000 objShell.Sendkeys "select count{(}*{)} from syscomments~" Wscript.Sleep 500 objShell.Sendkeys "-- Sending CTRL K~" Wscript.Sleep 1000 objShell.Sendkeys "^(k)" Wscript.Sleep 500 objShell.Sendkeys "-- Sending CTRL L~" Wscript.Sleep 1000 objShell.Sendkeys "^(l)" Wscript.Sleep 500 objShell.Sendkeys "-- Sending CTRL E~" Wscript.Sleep 1000 objShell.Sendkeys "^(e)" Wscript.Sleep 500 objShell.Sendkeys "-- Sending F5~" Wscript.Sleep 1000 objShell.Sendkeys "{F5}" Set objShell = nothing WScript.Quit -- Show quote-oj "Steve Beach" <ohbil***@GGGGGGGGGGGGGGGGmail.com> wrote in message news:unSaS7LhFHA.3936@tk2msftngp13.phx.gbl... > Were you able to get this to work? I thought I'd give it a try for > grins. But I can't seem to send any CTRL characters through WScript. > > Here is my test script. Watch for wrapping. > > Option Explicit > Dim objShell > Set objShell = CreateObject("WScript.Shell") > objShell.Run("""C:\Program Files\Microsoft SQL > Server\80\Tools\Binn\isqlw"" -Slocalhost -E") > objShell.AppActivate "SQL Query Analyzer" > Wscript.Sleep 1000 > objShell.Sendkeys "select count{(}*{)} from syscomments~" > Wscript.Sleep 500 > objShell.Sendkeys "-- Sending CTRL K~" > Wscript.Sleep 100 > objShell.Sendkeys "^K" > Wscript.Sleep 500 > objShell.Sendkeys "-- Sending CTRL L~" > Wscript.Sleep 100 > objShell.Sendkeys "^L" > Wscript.Sleep 500 > objShell.Sendkeys "-- Sending CTRL E~" > Wscript.Sleep 100 > objShell.Sendkeys "^E" > Wscript.Sleep 500 > objShell.Sendkeys "-- Sending F5~" > Wscript.Sleep 100 > objShell.Sendkeys "{F5}" > > Set objShell = nothing > WScript.Quit > > > > > oj said the following on 7/9/2005 2:44 AM: >> There isn't an option. But nothing is stopping you from writing a quick >> vbs >> to wShell.Run("isqlw -S<server> -U<user> -P<pwd>") then wShell.Sendkeys >> "^K" >> >> Funky. The reason why my original script didn't work is because of the
capital letters. Just changing ^K to ^k and ^L to ^l and ^E to ^e made it work. I tried manually hitting CTRL-L in QA (with caps lock on) and it worked. But hitting CRTL-SHIFT-L in QA did not work. I wonder if sendkeys is sending a CTRL-SHIFT-L when ^L is specified. A shift shouldn't be sent unless a "+" is specified. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsmthsendkeys.asp Anyway, thanks for the correction on the script. Perhaps the OP will make use of it. oj said the following on 7/9/2005 2:29 PM: Show quote > It works just fine. Try this. > > Option Explicit > Dim objShell > Set objShell = CreateObject("WScript.Shell") > objShell.Run("isqlw -Slocalhost -E") > objShell.AppActivate "SQL Query Analyzer" > Wscript.Sleep 1000 > objShell.Sendkeys "select count{(}*{)} from syscomments~" > Wscript.Sleep 500 > objShell.Sendkeys "-- Sending CTRL K~" > Wscript.Sleep 1000 > objShell.Sendkeys "^(k)" > Wscript.Sleep 500 > objShell.Sendkeys "-- Sending CTRL L~" > Wscript.Sleep 1000 > objShell.Sendkeys "^(l)" > Wscript.Sleep 500 > objShell.Sendkeys "-- Sending CTRL E~" > Wscript.Sleep 1000 > objShell.Sendkeys "^(e)" > Wscript.Sleep 500 > objShell.Sendkeys "-- Sending F5~" > Wscript.Sleep 1000 > objShell.Sendkeys "{F5}" > > Set objShell = nothing > WScript.Quit > Yup. Sendkeys sends literals. So, "^L" is equivalent to CTRL-SHIFT-L. ;-)
-- Show quote-oj "Steve Beach" <ohbil***@GGGGGGGGGGGGGGGGmail.com> wrote in message news:uvY%23ZGThFHA.3936@TK2MSFTNGP10.phx.gbl... > Funky. The reason why my original script didn't work is because of the > capital letters. Just changing ^K to ^k and ^L to ^l and ^E to ^e made > it work. > > I tried manually hitting CTRL-L in QA (with caps lock on) and it worked. > But hitting CRTL-SHIFT-L in QA did not work. I wonder if sendkeys is > sending a CTRL-SHIFT-L when ^L is specified. A shift shouldn't be sent > unless a "+" is specified. > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsmthsendkeys.asp > > Anyway, thanks for the correction on the script. Perhaps the OP will > make use of it. > > > oj said the following on 7/9/2005 2:29 PM: >> It works just fine. Try this. >> >> Option Explicit >> Dim objShell >> Set objShell = CreateObject("WScript.Shell") >> objShell.Run("isqlw -Slocalhost -E") >> objShell.AppActivate "SQL Query Analyzer" >> Wscript.Sleep 1000 >> objShell.Sendkeys "select count{(}*{)} from syscomments~" >> Wscript.Sleep 500 >> objShell.Sendkeys "-- Sending CTRL K~" >> Wscript.Sleep 1000 >> objShell.Sendkeys "^(k)" >> Wscript.Sleep 500 >> objShell.Sendkeys "-- Sending CTRL L~" >> Wscript.Sleep 1000 >> objShell.Sendkeys "^(l)" >> Wscript.Sleep 500 >> objShell.Sendkeys "-- Sending CTRL E~" >> Wscript.Sleep 1000 >> objShell.Sendkeys "^(e)" >> Wscript.Sleep 500 >> objShell.Sendkeys "-- Sending F5~" >> Wscript.Sleep 1000 >> objShell.Sendkeys "{F5}" >> >> Set objShell = nothing >> WScript.Quit >> |
|||||||||||||||||||||||