Hello, my name is Robert Pound, and I am a Quest technologist. This video covers getting started with the editor in Toad for SQL Server.
There are several different ways of opening up an editor tab in Toad for SQL Server. I'm going to simply choose the connection that I desire, and then click edit in the ribbon bar. This will open up a new editor tab. Later in the video, I will also show how to use database diagrammer and Query Builder to speed up development time.
Now that we have the editor tab open, if this is connected to the wrong connection, if I made a mistake, I can simply come to this icon at the top, and choose the correct connection, and it will change the connection to this editor tab itself. And you can see that I also have the ability to change the focus to the correct database.
So we can just simply begin typing, and it has the intelligent feedback built in that you may be used to. So I can start choosing the objects that I'm interested in, and it will pop up with the fields, and I click enter. And now I have a query built out.
Now looking at the ribbon bar inside the tab, you can see that there's several options for the execute itself. You can toggle variables in the editor. Again, we talked about selecting the database, and I will cover the rest of these just briefly.
So you have the ability to format your SQL so that it conforms to formatting rules that you set. You can append or remove application code. You can reverse engineer this query back to the Query Builder, which we'll talk about briefly in a second.
You can also send this to an automation script, which is supremely helpful when you want to reduce the amount of routine tasks that you do. You can also optimize this code, and then send it to a stored procedure etc.
You also have the debug functions here. And then you have some of your export functions as well. Once you get the data, you want to export it out.
So that covers the basics of the editor. I will go ahead and run the statement real quick. Now that the statement is run, we have results in the result tab. If I run it again real quick just to show, you're going to have several tabs, one for each execution basically.
So these are the results. Messages, if there's any errors, they'll pop up here. This is where you view the execution plan. You can also do a pivot chart to quickly verify the data that you're looking at. You simply drag and drop columns.
There's obviously no visual information for this particular query. And also, profiling is supremely helpful for understanding the makeup of your tables themselves. So if you have a missing field duplicates, etc., this will show up here.
For a more detailed view, you have to check out Toad Data Point. So if you're interested in that, I encourage you to go to quest.com to find out more information.
And that's the quick overview of the editor itself. Now, as I talked about at the beginning of the video, also a quick run through. So if I was interested in this table, for instance, and I wanted to create a query, but I wanted to also see what other information I could pull from the database, I can simply choose database diagrammer from the right-click menu.
And I will be prompted with this warning if this is the first time I've opened it. But, essentially, what it's going to do is pull in this table and any associated tables in the database.
So this gives me a visual representation of how tables are related, and I may not be interested in all of these tables for the given query that I'm interested in, so I can simply close out any table that I don't want to view.
So now, I want to look at simply these two tables. I can simply right-click and choose send to Query Builder. And now, I am presented with basically a visual query. So if I wanted to see a few of these fields, I can simply click on them, and as you can see as I'm clicking on, it's populating this window down below.
And we'll go ahead and select a few of these on this table as well. And from here, you can also start filtering and modifying the statement. You can alias the fields.
I'm just going to simply choose execute here at the top. And it's going to come back with the results. Now, as we were selecting the given fields, it's building out a query in the query tab. So you could simply copy and paste from here into an editor if you wanted to develop further, or you can come to the top here in any of the windows and click open in the editor.
Now from here, you can continue to develop the code as you see fit. But this is a way to quickly get started with the development itself.
And that's all I really had to share. I hope this video helped you understand a little bit more about the editor. For more information on this product you can visit www.quest.com/products/toad-for-sql-server. You may also check out www.toadworld.com to get insights from the database professionals there. Thank you, and have a great day.