Tag: Copilot

  • A Small LLM Fail

    Another test with Copilot in SSMS (v22 P3) that didn’t go so well. This one surprised me.

    This is part of a series of experiments with AI systems.

    Looking for Known Data with Copilot

    One of the things I wanted to do recently was do some checkdb checking of a system. As a result, I was looking for the last time this was run on a database. I decided to ask Copilot.

    2025-10_0169

    This made perfect sense, as this was a new restore, and I hadn’t run it. So I asked for the query.

    2025-10_0170

    This doesn’t work, but I’ve gotten used to pasting in errors and letting the LLM sort this out. So I did this.

    2025-10_0177

    OK better, but this still doesn’t work.

    2025-10_0178

    I apply this and run it, and it works, but doesn’t return data. I wouldn’t expect this to for this database, so I try to clue in the AI.

    2025-10_0179

    Seems wrong. On this page, DatabasePropertyEX, I see this:

    2025-10_0180

    Not sure why this doesn’t work well. I don’t see a way to change the model, so I’m not sure what’s being used or when it was trained, but I’d expect it to know what is in DatabasePropertyEX().

    Prompt AI

    Prompt AI was a little better, though not at first. I asked the question:

    2025-10_0181

    I got this:

    2025-10_0183

    I can’t select this code (submitted a bug), but this isn’t bad. The result of my next query failed as well.

    2025-10_0184

    At least I had a clue what to do. I started then with this:

    2025-10_0185

    I got the “with TableResults” added. I then asked it to modify this to find the last time DBCC CHECKDB ran. I got this:

    2025-10_0187

    Summary

    To be fair I futzed with both of these a few times. An LLM isn’t deterministic, so I got different results, but I never got the correct result from Copilot. I did get this from PromptAI at one point, which does work.

    2025-10_0188

    GenAI’s are funny beasts. You definitely need to spend some time learning how to use them.

  • A Broken Copilot Query

    I was testing the new SSMS (v22 Preview 3) with Copilot and ran into an interesting issue.

    This is part of a series of experiments with AI systems.

    My Query

    I was working on something unrelated and tried this prompt, which should have saved me a few minutes from looking on MSLearn.

    2025-10_0168

    As you can see, I get a nice list of things. However, then this happened.

     

    This kept going. I gave it a minute, then opened my screen recorder (which is close to a minute) and started recording.

    After capturing this, I stopped the query. Things seem to work OK, but this is definitely something that concerns me about agents and letting them go. I don’t know if this was a stuck process, if this was consuming compute or tokens, but it was certainly an issue.

  • Copilot Reminded Me How To Find a File Handle

    Recently I was trying to delete a folder and kept getting the “something is using this, try again” dialog. It was annoying, but I couldn’t figure out what process had this folder locked. I know there are ways to do this, but I decided to ask Copilot how to do this.

    I did this in the Edge browser, since that’s the easy thing. Note: I was actually on Windows 10, not 11.

    I got this response.

    2024-05-21 11_28_16-2023-John S & Atieh V Jones-Workpapers-12.31.23 Jones, John S Organizer 23486 V1

    I then hit Ctrl+Shift+Esc and got the Task Manager. From there, I can see Resource Monitor at the bottom of the Performance tab.

    2024-05-21 11_32_12-Task Manager

    I opened this and it started in the CPU tab. I typed in the name of my folder, and I saw that there was a CMD window open with the handle. I then realized I had a window in my list, which I exited.

    2024-05-21 11_33_08-Resource Monitor

    Once I did this, I could delete the folder.

    It This Better?

    Not necessarily. If I run a search, I see lots of results. In this case, any of these could be clicked, but in the past, I’ve often had to click multiple results to find something that works. I supposed Copilot could have given me a poor answer, and I’d have to refine the prompt, so the process might be the same.

    Except.

    Here I am working in one place and not clicking other links, potentially finding down sites, 404s, or other issues. It feels slightly cleaner. It also means I can have context if I refine my search.

    I don’t know if it’s better, but I find myself leaving an Edge tab open to Copilot to try stuff.

  • ADS Copilot Experiments with XML

    I sent some code to a customer recently to help them decrypt some stored procedures. I sent a quick and dirty set of code, noting at the bottom that the results were in XML and needed to be extracted.

    The customer wrote back that my code produced XML and the procedure code had to be copied and pasted into SSMS to create a decrypted procedure.

    1f926-2642

    Before I spent time on this, I decided that I should play with Copilot here. This is the perfect place and it’s what I’d hope at some point if I sent that code, the other person would use some sort of AI to help them fix things.

    Maybe not, but here’s what happened.

    This is part of a series of experiments with the ChatGPT and other AI systems. Lots of Copilot lately.

    Asking for Help

    I could look up the syntax for working with XML, but what about Copilot? Let’s see what happened.

    2023-08-03 15_37_47-● SQLQuery_1 - Aristotle_SQL2022.sandbox (Integrated) - VCS_Primer-1 - Azure Dat

    An interesting suggestion. One problem: when I run this, the result isn’t great.

    2023-08-03 15_38_41-● SQLQuery_1 - Aristotle_SQL2022.sandbox (Integrated) - VCS_Primer-1 - Azure Dat

    If I cast this as XML, or declare it, things work. At least, they don’t produce errors. But they don’t do what I wanted.

    2023-08-03 15_39_52-● SQLQuery_1 - Aristotle_SQL2022.sandbox (Integrated) - VCS_Primer-1 - Azure Dat

    I wasn’t sure what to do, so I opened the completions panel for Copilot and saw other suggestions.

    2023-08-03 15_40_47-● SQLQuery_1 - Aristotle_SQL2022.sandbox (Integrated) - VCS_Primer-1 - Azure Dat

    Let’s try these.

    Suggestion 1 looks good. If I change my declaration to be XML, this works (or cast things).

    2023-08-03 15_41_51-● SQLQuery_1 - Aristotle_SQL2022.sandbox (Integrated) - VCS_Primer-1 - Azure Dat

    Some points for Copilot here, and I’d hope a junior would get to change the declaration or ask how to convert the variable to XML. 

    Suggestion two doesn’t work.

    2023-08-03 15_43_57-● SQLQuery_1 - Aristotle_SQL2022.sandbox (Integrated) - VCS_Primer-1 - Azure Dat

    Suggestion three looks like a copy paste from a forum somewhere. However, the code works. I don’t know how this gets into the suggestions, but I am interested to know what’s happening here.

    2023-08-03 15_45_03-● SQLQuery_1 - Aristotle_SQL2022.sandbox (Integrated) - VCS_Primer-1 - Azure Dat

    Four and fix aren’t great. They look like repeats. However, six accounts for my declaration.

    2023-08-03 15_46_25-● SQLQuery_1 - Aristotle_SQL2022.sandbox (Integrated) - VCS_Primer-1 - Azure Dat

    Does the code work? It does.

    2023-08-03 15_46_46-● SQLQuery_1 - Aristotle_SQL2022.sandbox (Integrated) - VCS_Primer-1 - Azure Dat

    I accepted solution 6 to see what happens. The code was added to the query window.

    A Repeat

    I’ve given feedback, so let’s try again. I went back to the prompt and got the same suggestion again, however when I opened the panel, I saw different items.

    2023-08-03 15_50_38-● SQLQuery_1 - Aristotle_SQL2022.sandbox (Integrated) - VCS_Primer-1 - Azure Dat

    One doesn’t make any sense and doesn’t work. Two and three are nonsense. Four is really interesting, but not useful.

    2023-08-03 15_52_17-GitHub Copilot - VCS_Primer-1 - Azure Data Studio

    I don’t think Copilot learned anything, and I’m not even sure it is all that well trained. I don’t know if it doesn’t recognize it’s in a database editor or what. The type of language for the ADS file is SQL, so I don’t know what X# and Java are added.

    I’m out of patience today. I know how to do this, so I’ll just write the code.