Then, I want to make sure that I'm targeting the Postgres database to start. Then, I'll choose my PostgreSQL on Docker server, from the recent list, and press Connect. So up here on the top, you can either press the Change Connection button if it's connected to a server, or since mine isn't, I'll press the Connect button. Now, the first thing we want to do is make sure that we connect to the appropriate database server. ![]() So make sure that you load up the file here for PostgreSQL, and we'll execute it on that server. That's why there's two different versions of this file, depending on what platform you're going to run it on. There are slight differences in the SQL language between the two platforms, between PostgreSQL and SQL server. And you can use this file to recreate that database on this SQL server instance, in case you weren't able to load the backup file in the previous chapter. Now, I'll also point out that there is an additional copy of this file, called TwoTrees - SQL Server.sql. You can double-click on it to open it up in a new editor tab. The script that I have for that is called TwoTrees - PostgreSQL.sql. Okay, so now let's go ahead and turn our attention to recreating the Two Trees database on the PostgreSQL server. And there's that code.workspace file, if I ever need to reload the workspace. To do that, go up to the File menu, choose Save Workspace As, and I'll save a copy of it into the Chapter 3 folder, and I'll call it "Chapter 3." That'll place that file right into that folder. While I'm at it, I might as well save this new workspace so it can be reloaded quickly in the future if I need it. Then, we can flip back over to the Explorer sidebar, and there's all my Chapter 3 files. That'll reload Azure Data Studio, and I might need to go through and reconnect to my database servers. I'll choose the Chapter 3 folder and press Select. If you have files here from the previous chapter, you'll need to go up to the File menu and then choose Close Workspace to reset it. To start, click on the Explorer icon over here on the sidebar. ![]() Let's create a new workspace for Chapter 3, now, to make it easy to access this file. I have the full SQL script to do that saved in the Exercise files. I'd now like to add in a copy of that database into the PostgreSQL server as well. Now, previously, I loaded a copy of the Two Trees database onto our SQL server instance. But the program will help get you started, and you can easily save and reload existing script files so that you don't have to write everything out every single time. To get the most out of Azure Data Studio, you're going to need to be familiar with reading and writing SQL queries. Management of any relational database requires you to write and execute commands written in SQL, or Structured Query Language.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |