In the previous chapter, we have introduced how to create an SQL azure database. This chapter describes how to use SQL Server Management Studio (SSMs) to connect to and manage SQL azure databases. Install SQL Server manage studio to prepare the teaching content.
1. First we log on to the Windows azure user management interface https://windows.azure.com/
2. select "Database" --> select subscription, find the newly created "newdb" database, find "connection string" in the "properties" column on the right, and select "View" on the right.
3. In the pop-up window, we can see the connection string connecting to the SQL azure database. We select this connection string and copy it to the clipboard.
5. Open the local SQL Server Management Studio (SSMs ). Copy the SQL azure connection string of the clipboard in server name, and enter the Administrator's username and password in login and password.
6. In object explorer, we can see that the SQL azure database is no different from the local database. We can see the default master database of SQL azure and the newdb database we created earlier.
7. I can see that I am currently connected to the master database. What should I do if I want to switch to the newdb database? Experienced developers will surely think of using the use command. So I executed this command: Use newdb. However, execution fails.
The red error message tells us that the use statement is not supported in SQL azure.
What should we do if we want to switch to the newdb database? We can only disconnect the current connection and then re-connect to the SQL azure server.
8. We will disconnect the current connection and re-enter "options" in the logon window"
9. In connection to database of "Connection Properties", select "Browse server"
10. After a moment, SSMs will read all the database information in SQL azure. Then we select newdb and click "OK"
11. newdb becomes the database we want to connect to. We chose "Connect" to log on to SQL azure.
12. RunSelect db_name ()To determine the selected Database