Glitch using dm_exec_query_plan

I was experimenting with sys.dm_exec_query_plan the other day and ran into a strange glitch. The select from dm_exec_query_plan does not seem to want to be restricted to specific databases. I know this because one of the databases on my server was set to
single-user mode, and when I ran the following query I was getting an error because of that:
SELECT
cp.refcounts
,cp.usecounts
,cp.objtype
,cp.[dbid]
,cp.objectid
,cp.[text]
,qp.query_plan
FROM sys.dm_exec_cached_plans AS cp
CROSS APPLY sys.dm_exec_sql_text(cp.plan_handle)
AS st
CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle)
AS qp
JOIN sys.databases db ON db.database_id = qp.dbid
AND db.name = 'mydb'
I would have thought that restricting the results to a particular database (one that isn't in single-user mode) would have caused the error not to occur, but it did not. I fiddled around with a couple of other query formulas and finally found one that worked:
WITH cteCachedPlans AS
( SELECT *
FROM sys.dm_exec_cached_plans AS cp
CROSS APPLY sys.dm_exec_sql_text(cp.plan_handle)
AS st
JOIN sys.databases AS db
ON db.database_id = st.dbid
AND db.name = 'STAX'
SELECT
cp.refcounts
,cp.usecounts
,cp.objtype
,cp.[dbid]
,cp.objectid
,cp.[text]
,qp.query_plan
FROM cteCachedPlans AS cp
OUTER APPLY sys.dm_exec_query_plan(cp.plan_handle)
AS qp
WHERE qp.query_plan IS NULL
Notice that I am using an "outer apply" here. If I use an "inner apply" the error still occurs, even though the results from the CTE are restricted to a single database that is not in single-user mode. This seems like strange behavior
to me, has anyone else run into it?
Thanks,
Ron Rice
Ron Rice

I'm not sure what error message you are getting. I guess that I could test myself, but I'm about to withdraw for the night.
In any case, the filter is necessarily not applied before the operator that results in an error because of the single-user database. Changing CROSS to OUTER APPLY may change the query plan, but that may be pure coincidence.
Erland Sommarskog, SQL Server MVP, [email protected]

Similar Messages

  • Vim color glitch using Xterm

    Hello,
    I recently started to use Xterm rather than urxvt, and there's a weird glitch when using vim. I have cursorline enabled, so the background of the cursor line is a different color from the regular background, and I used this config in urxvt and termite and it works properly. However, in Xterm, when I scroll down, the cursor line leaves a "trace" on the background where there is no text.
    http://i.imgur.com/9CO522D.png
    This is a screenshot of the issue I'm having, and I am using vim to edit my colorscheme file, urxvt is on the left and xterm is on the right. As I said, this colorscheme gave me no problems on urxvt and termite, but in case I'm missing something I thought I might as well show it.
    Also, the comments in the colorscheme file shouldn't have a separate background either, and they don't in urxvt, and there shouldn't be yellow highlighting on '=dar' at the top of the colorscheme file. I don't understand why there can be so many differences from terminal to terminal.
    Can anyone help me fix this?
    Thanks,
    wadawalnut
    -- mod edit: read the Forum Etiquette and only post thumbnails http://wiki.archlinux.org/index.php/For … s_and_Code [jwr] --

    Does the problem occur with other vim colorschemes? Perhaps we can eliminate the colorscheme and any .vimrc configurations or plugins as the source of the problem.
    You can create a very basic .vimrc file, perhaps naming it basic.vim
    set nocompatible
    filetype plugin on
    set t_Co=256
    syntax on
    Start vim using basic.vim instead of your .vimrc:
    $ vim -u basic.vim <file_to_edit>
    Vim should open with the default colorscheme. Then add cursorline highlighting and see if the problem exists.
    :se cul
    If the graphical glitch is there, you've pretty much eliminated your .vimrc as the source of the problem. If the "tracing" problem isn't there, change to a colorscheme where you know it has previously occurred.
    :colo <my_colorscheme>
    Try editing different filetypes to make sure the problem isn't a filetype or syntax plugin.
    Edit: Ctrl+l, (Control plus lowercase L) should refresh the screen in vim.
    Last edited by thisoldman (2015-03-08 18:47:05)

  • [SOLVED] Glitch using anti-aliased font in Terminator ...

    Hi ( sorry for my poor english )
    I've just installed Archlinux and it works well but I've a font problem using any terminal ( as far as I can test, I've installed Terminator, urxvt, xfce4-term ... )
    When I use an "aliased font" I've got glitchs as shown on this screenshot http://img687.imageshack.us/img687/1108/screennm.png
    But when I change font for a normal one ( aliased ) everything work fine.
    Is there any way to make anti-aliased fonts working with terminal ?
    Thanks in advance.
    Edit: Fixed, it was the "loose binding" option from compiz that creates the glitchs.
    Problem solved !
    Last edited by Supergeoff (2009-12-10 10:56:11)

    i already do have anti-aliasing turned on. black text on a white background is anti-aliased as expected. i'm trying to use white on black and the difference, while subtle, is there. since i sit in front of a terminal and program all day, i want a font and display combination that is easier on my eyes than what i'm seeing now. i'll go back to black text on light background for now, but in the long run i prefer the opposite style.
    iMac Mac OS X (10.4.7)

  • Forum software glitch using id numbers

    Last night I posted a reply to someone's question and I noticed that the forum was going
    through a phase where it was ignoring people's nicknames and just using id numbers. So the forum software posted the
    answer under my id number not my nickname. Then today I see it went back to nicknames.
    When it converts to nicknames, the messages sent under the id number become invisible.
    The poster would have to go in via the control panel to see the original posting as one way
    to find such a message. I just thought I'd mention it that some messages were possibly effectively lost.
    Edited by: lake on Dec 27, 2010 10:53 AM

    Hi,
    That's defniitely not the first time that's happened: Now i'm 115867
    Sometimes, I'm just 503936 and other times I'm my email address! Like I say in the above thread, how can a SSO glitch change my handle? Stuuuuuuuuupid forum software!
    Andy

  • Audio issues and glitches using either Logic Pro 9 and iTunes library from OS 10.9

    Since the new update to OS 10.9 have been experiencing some unwanted glitches with beach ball pop ups when working in logic pro 9.1.8 and itunes 11.1.3.
    Can anyone tell me if this a troublesome Maverick OS 10.9 bug that needs fixing or am I just having trouble with logic pro 9, audio interface Apogee, or internal hard drive issues???
    Your reply would be gratefully appreciated.
    Yours,
    Jonnichi

    Hi Guys
    Thanks for your help, i've managed to solve the problem by myself
    Solution
    1. Start Logic in 64bit mode - see here for more info
    2. Open the crashing file
    3. The file will crash but this time you'll see a message on the pop dialog saying "32 Bit audio unitbridge quit unexpectedly while using the Massive plugin"
    4. Confirm the plugin name cousing problems in the error/crash report - look for this line; Plugin identifier:Massive.MusicDevice.componet - in this case, the Native Instrument Massive caoused the problem and had to bounce a short audio loop, I am lucky couse the AU wan on looping melodies. Try to reload the application in 32bit mode or use alternative.
    5. Problem solved

  • Audio Transition Glitches - A Different Approach

    I have noticed a lot of users are having problems with the audio noise that sometimes arises when you insert transitions. The Apple workaround is to extract the necessary audio and then uncheck the video sound box in the video/audio timeline viewer as this is where the static is caused.
    However, this tends to be annoying if you want to either edit or perhaps add further transitions that cut through video where you have already extracted the audio.
    Another option is a workaround that I have used constantly in iMovie 3.03. That is to add a title transition (with nothing in it) that floats over the transition where the sound glitch occurs!
    For example
    1. In iMovie HD 5.02, cut the clip before the sound glitch using command-T.
    2. Add a title effect - I tend to use a subtitle as it is usually what I'm working with, but other effects (like centred) work just as well. CLEAR the contents of the title boxes. Make it long enough to cover the audio problems and apply...
    3. You will either get a magnificant solution to your problem (which is especially good as it is an undoable feature by pressing backspace after the clip is highlighted) OR you will get one more sound glitch at the end of the title effect. BUT IF YOU REPEAT THIS PROCESS by adding (and you might as well make the effect as long as possible) title effects throughout the whole project, the amazing thing is that when these effects run together - You get no noise!!!!
    Ok, you might get noise if you were unfortunate enough to finish the title effect right on a transition and in this case you obviously need to ensure that you don't do this by varying the length of the transition.
    IN SHORT....
    1. Ignore the problem until you have finished your project.
    2. (Worst case) Add long blank title effects starting at the beginning and continue adding them until you reach the end.
    An added advantage is that this beats the endless audio extraction that some of you will otherwise have to do to "fix" this annoying problem.
    Anyway I hope this works as well for you as it has done so for me.

    I haven't tried this "stitching" (..I extract audio anyway at transitions, so that I can mix more audio into those transitions..), but Lennart has often suggested using 'blank' titles as a means to join clips together when anyone asked if there was a way to merge two clips into one.
    Good detective work!
    [..Audio 'spikes' are also removable using Sound Studio or other audio editing software..]

  • Cannot use Chess with this version of Mac OSX...?

    When I first installed Leopard, Chess (the Apple app) worked fine. Now, after updating to 10.5.1 I get a message saying I can't use it with this version of OSX when I try to open it. Any idea why? Can I get Chess back? Is it just me?

    Andrew Butterfield wrote:
    Obviously some little glitch, but now it's working fine. Just wish I could beat it occasionally. Still, hope lies eternal...
    It is likely that in the Dock, you had a pointer to the pre-Leopard version of Chess left over from an upgrade or archive & install, so that version was trying to launch from the Dock. "Get Info" tells me that Leopard's Chess is version 2.3 & it even has a checkbox for "Open in 32 bit mode" -- something I haven't seen before.
    If you have any other similar Dock-related glitches, use the "Show in Finder" Dock menu option to find the app & see if it looks like a Tiger "leftover."

  • Hero + FB + webservice = glitch?

    Hello,
    I'm trying to build my first mobile app using sdk hero in flashbuilder.  There seems to be a glitch using the generated webservices.  It fires off in a random type pattern.  for example, I click the button that triggers the event and sometimes it works.  Other times, no busy-cursor, no result, no fault.  I have android.internet permissions in the application mxml and I know I can access the internet via the computer.
    Any ideas as to what might be happening?
    If I trace a glitchy run:
    the click handler has been accessed
    the service public function signIn has been accessed
    the public function _Super_Loginservice has been accessed
    but no busy-cursor, no result, no fault.
    Thanks!
    Actually, I should also point out that the glitch seems to be per build.  As in, a glitchy build will always be glitchy, and a non-glitchy build always works.  The difference?  (how hard I click the green play button?  j/k)
    I should also make mention that I'm using FB "Burrito"

    Hi,
    There's a difference between an app running on Android with the AIR runtime,
    vs a Flash web app running in the browser. Currently Xoom supports the AIR
    runtime, so you can create apps with AIR for Android and deploy them to the
    device now, without needing the Flash Player in the browser. By March 18,
    the Flash Player for the browser will be available to the Xoom. Flash Player
    in the browser is separate from the AIR runtime.
    When creating apps with Flash or Flex using the AIR for Android deployment
    option (currently in FB Burrito or Flash CS5 latest update) you can create a
    .apk file that can be installed onto any Android device that supports AIR:
    http://www.adobe.com/flashplatform/certified_devices/
    iBrent

  • Disappointed by nokia product and support

    Nokia you cheated me. I bought c6-00 14000 INR. But not worthy to what I paid. Due to this customer dissatisfaction you lost global market share. You strong in hardware but failed in os innovation. I don't known what is obstructing you from taking decision.
    Now I afraid to buy your most high ends phone lumia 920 after I got bad and difficult experience by using nokia c6.
    Already one of my friend has been facing glitches using lumia 610.
    Correct your organization else you would loose your place in the market.
    If you found any mistake in this message, it due your phone only.
    I have been cheated by you

    You can't really base your experience with the C6-00 and the 920. The two have completely different OS's. WP8 on the 920 is a great experience and I'm sure you'd like it if you gave it a try.
    Ray.

  • IPhone 3.0 and ICS files from Google Calendar

    I was under the impression that ICS files would be supported in v3.0 of iPhone. The phone seems to recognize the ICS files and i can now click on them in the email but it takes me to a blank screen. I also do not get the automatic notification I would expect in the Calendar app that a new event is waiting for me even though the pref is enabled to do so.
    What am I possibly doing wrong and how can I make this work as I think it should?
    Thanks,
    Brian

    Glad you got it sorted. I must admit, I've had a number of glitches using the new copy and paste feature with URL's.
    In answer to your question: Is this better than Google Sync/Exchange? I think the answer is "no". Exchange is a lot easier to setup in this case. But as I said in my blog, for people like me Exchange isn't an option - as I'm already using that account to connect to my corporate email.
    What I'd like to see (maybe in 3.1? :o) is "Google" listed as an option when you're setting up a new account. An automated, all in one solution giving you access to your Google calendars, mail and contacts would be fantastic!

  • Photoshop Elements vs. Photoshop with Lightroom

    Are there any limitations to transferring photos and editing using Elements as opposed to full Photoshop? I've had a few glitches in the quality of the photos after editing in Elements and then bringing them back to Lightroom.

    I've had a few glitches in the quality of the photos after editing in Elements and then bringing them back to Lightroom.
    Unless you describe the "glitches", there's no way to be sure the problem is Elements and will be solved by using Photoshop.
    There should be no "glitches" using Elements, and most people who use Elements with Lightroom do not have "glitches"

  • Qosmio G15-AV501: Where to find the Vista graphic driver

    Hi,
    I have searched the world, looking for VISTA drivers especially NVIDIA drivers for my G15 AV501 - Toshiba says the G10 is the same, but that doesn't heelp either, I am running vista and it seems to be a little slow with a couple of small glitches, using GEFORCE 6600 - but it not perfect.
    Any thoughts would help
    Thanks to all

    Hello,
    I think your notebook uses the Nvidia FX5700 128mb graphics card. If so, please follow the link below to install the driver:
    Link to download the driver:
    http://www.rabayjr.com/vista/drivers/nvidia96.85.rar
    Before perform this, uninstall everything related to Nvidia from your computer
    To install the nvidia 96.85, you must do it manually:
    open the Device manager
    look for the Video adapter/nvidia Gforce Fx5700
    Driver update options
    Look for a software driver in computer
    Choose a list of device drivers in computer
    With disc...
    Look for the place you've extracted the nvidia 96.85.rar
    Find the nv_disp.inf and open it
    You will come to the following screen:
    http://www.rabayjr.com/vista/qosmiofx5700.jpg
    From a list choose your video card (Fx5700) and install it.
    Hope this help you to solve your graphic card problem
    OBS: If your notebook is using the Nvidia Geforce go6600, please let me know because for this, is another nvidia driver.
    Francisco

  • Audio Blips in transitions, Part VIII ... continuing

    Driving me crazy, practically ALL of my transitions have the sound click or blip at the beginning and end of a transition. I've got music on the second track- so all I want is silence - everying set to zero, nevertheless... So, I've deleted the transition, extracted the audio from both sides, added a new transition (between two clips with zero audio... and Viola'!! Sound blips are there again. (and I tried deleting the audio clips... this combo is not working. Here's the apple advice:
    (new input WELCOME...thanks)
    You hear a pop or gap during a title or transition in iMovie
    After applying a title or transition, you may sometimes hear a pop or brief period of silence between the transition and the next clip.
    This can happen when using iMovie versions 3, 4, and 5.
    If you experience this, try extracting the audio from your video clip to a separate track before applying the title or transition. Follow these steps:
    Select the affected clip.
    To undo the title or transition you have added: From the Edit menu select Undo, or from the Advanced menu select Restore Clip.
    Select the video clip in the timeline.
    From the Advanced menu, select Extract audio. The audio for the selected clip will be moved to its own audio track in the timeline.
    Add your transition or effect.
    This document will be updated as more information becomes available.

    I have noticed a lot of users are having problems with the audio noise that sometimes arises when you insert transitions. The Apple workaround is to extract the necessary audio and then uncheck the video sound box in the video/audio timeline viewer as this is where the static is caused.
    However, this tends to be annoying if you want to either edit or perhaps add further transitions that cut through video where you have already extracted the audio.
    I think another option for iMovie HD 5.02 is a workaround that I had used constantly back in iMovie 3.03. That is to add a title transition (with nothing in it) that floats over the transition where the sound glitch occurs!
    For example
    1. In iMovie HD 5.02, cut the clip before the sound glitch using command-T.
    2. Add a title effect - I tend to use a subtitle as it is usually what I'm working with, but other effects (like centred) work just as well. CLEAR the contents of the title boxes. Make it long enough to cover the audio problems and apply...
    3. You will either get a magnificant solution to your problem (which is especially good as it is an undoable feature by pressing backspace after the clip is highlighted) OR you will get one more sound glitch at the end of the title effect. BUT IF YOU REPEAT THIS PROCESS by adding (and you might as well make the effect as long as possible) title effects throughout the whole project, the amazing thing is that when these effects run together - You get no noise!!!!
    Ok, you might get noise if you were unfortunate enough to finish the title effect right on a transition and in this case you obviously need to ensure that you don't do this by varying the length of the transition.
    IN SHORT....
    1. Ignore the problem until you have finished your project.
    2. (Worst case) Add long blank title effects starting at the beginning and continue adding them until you reach the end.
    An added advantage is that this beats the endless audio extraction that some of you will otherwise have to do to "fix" this annoying problem.
    Anyway I hope this works as well for you as it has done so for me.

  • PSE10 & ACR: A Basic Question

    I have been using PSE8 because of the full-featured version of ACR (v. 5.7 hosted by Adobe Bridge; not the version hosted by PSE8) for several years. To my dismay, this version of ACR does not support RAW files from Canon's 60D camera. Since I have been experiencing trouble using Adobe's DNG Converter, I am considering upgrading to PSE10.
    Question: Does PSE10 contain the full-featured version of ACR or just the abbreviated version?
    Thank you kindly.

    I think it's probably one of those things that was overlooked, whether by mistake or on purpose, i cannot say, but 100's if not thousands of people have the same "glitch" using pse 8 on macs.
    Examples of some other "overlooked" functions in various versions of elements
    Photoshop elements 1 has an easy workaround for getting a layer mask
    Photoshop elements 2 has a full brushes palette just like photoshop 7
    Photoshop elements 3 has the Select>Color Range command
    Photoshop elements 4 has Smart objects
    Photoshop elements 5 has Lab mode
    Photoshop elements 6 has an editable black and white adjustment layer
    These are just a few of many functions in elements that aren't "supposed" to be there.
    I should add that most of the above require an action from photoshop to enable them, but they are there.

  • ITunes songs cause video to skip in iMovie

    Hi, this is a new problem I never used to have. ANY iTunes songs I've ever bought and downloaded, when imported into iMovie to provide music for my video, cause the video images to skip. I think because it's ACC protected music, but come on! I paid for it, can't I use it in my movies? Can I change my songs to MP3s, and if so, how? would that solve the problem if I re-imported them in that format?
    It never used to do this to me. It used to import music files fine.
    Thanks for any help.

    In addition to Bengt's solution, if you don't want to take the time to make a CD and import it back into iTunes, you can use Wiretap Pro(free version) to record whatever music or sound you want. It creates an audio file (AIFF) that can easily be put into iMovie. It is great if you just want to have a portion of a song in your movie clip. I have also used it to add sound to a still photo inserted into the video. I find it faster and easier than 'extracting audio.' This neat little app also avoids any audio glitch using 'pasteover.' I record just what I want and save it to the desktop, then just drag it directly into my iMovie's audio track.
    You can find more information and download it here WireTap Pro

Maybe you are looking for

  • I want to create a "batch file" that will copy files from one folder into another, overwriting what is currently in there.

    I've got a game that has a folder with Saved Games (Okay, it's Minecraft). I don't always have my external drives because I take my Mac Mini from my house to my friend's house and of course back after we finish playing. There are times where I want a

  • Instrument I/O Assistant not properly installed

    Hi, I recently purchased a student edition of Labview 2009 and I've been having problems with the intrument I/O Assitant. Each time I place it on the block diagram I get the error message that it was not properly installed. I've searched the knowledg

  • How do i change the   database port for enterprise manager for 10g

    I ma having a problem launching my enterprise manager from my web browser ,the problem is may be there is another service using the default port which is 5500 and now i want to change it to another port but which file in the oracle installation path

  • DB13 Finished With Error

    Hi All, We have Solution Manager 4.0 with Database Oracle 10.2 and Windows NT  as Operating System. OS Details are as follows MS Windows Server 2003 R2, Standard Edition Service Pack1 and 4 GB RAM.It's 32 BIT system. Very Oftenly DB13 fails after run

  • How to configure corporate chart of account?

    Hello, While creating G/L account in FS00 i got this error "no corporate chart of accounts is defined for chart of account CAKP" Here CAKP is my company chart of account, we copied from 3000. I cant configure any account because of this error. Help R