Create, configure, and manage SQL Server information on Global Azure

Source: Internet
Author: User

Create, configure, and manage SQL Server information on Global Azure

A lot of recent documentation on Azure has been written about how to configure and manage SQL Server information on Windows Azure today, and our experiment today is still done with global azure; in fact, SQL on Windows Azure The server structure is similar to local, except that SQL Server data created on Azure does not have the system default administrator privileges, such as the need to specify the database administrator information when the database is created, and not the SA as the Administrator account;

We first click the SQL database---add

650) this.width=650; "title=" clip_image002 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image002" src= "http://s3.51cto.com/wyfs02/M01/78/BB/wKioL1aCTl7zapKZAADakCA9PeU318.jpg" height= "550"/>

Since we have not created a SQL database in our environment, we need to create a SQL Server and specify the server name, administrator login name and password.

650) this.width=650; "title=" clip_image004 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image004" src= "http://s3.51cto.com/wyfs02/M02/78/BD/wKiom1aCTkTz7YnUAAFhlQvixtA009.jpg" height= "684"/>

The default is to select the sort in the graph as the default, so we can define it according to different requirements;

Note: Global sorting will not be the same as Manoul, can come down, the current global is unable to pull down, specific to the end of the article we have introduced;

650) this.width=650; "title=" clip_image006 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image006" src= "http://s3.51cto.com/wyfs02/M02/78/BD/wKiom1aCTkWCR6_jAAEkFXYACBY702.jpg" height= "703"/>

Create a resource group, which is actually a directory structure on Azure for better management

650) this.width=650; "title=" clip_image008 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image008" src= "http://s3.51cto.com/wyfs02/M00/78/BD/wKiom1aCTkeyjXByAAFK_99AFyM155.jpg" height= "686"/>

Start creating a SQL Server database

650) this.width=650; "title=" clip_image010 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image010" src= "http://s3.51cto.com/wyfs02/M00/78/BD/wKiom1aCTkjgK5kcAAC1QJwjzKM981.jpg" height= "462"/>

Database Creation Complete

650) this.width=650; "title=" clip_image012 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image012" src= "http://s3.51cto.com/wyfs02/M01/78/BB/wKioL1aCTmSyXStNAADjAsz8U98235.jpg" height= "572"/>

We view database Configuration properties

650) this.width=650; "title=" clip_image014 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image014" src= "http://s3.51cto.com/wyfs02/M02/78/BB/wKioL1aCTmWg440xAAEbh5TD5_Y002.jpg" height= "514"/>

650) this.width=650; "title=" clip_image016 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image016" src= "http://s3.51cto.com/wyfs02/M00/78/BB/wKioL1aCTmewnIMwAADoc8f6lwA628.jpg" height= "593"/>

Then we use SQL Server Manager studio to manage Azure US SQL Server

Azureusdbserver.database.windows.net

650) this.width=650; "title=" clip_image018 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image018" src= "http://s3.51cto.com/wyfs02/M01/78/BB/wKioL1aCTmjxGjcoAAE8CD4bkBg571.jpg" height= "471"/>

Unable to connect to the SQL Server server properly with a valid user and password

650) this.width=650; "title=" clip_image020 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image020" src= "http://s3.51cto.com/wyfs02/M02/78/BD/wKiom1aCTk6Sxab_AAFXll5A-Nc322.jpg" height= "461"/>

https://azure.microsoft.com/zh-cn/documentation/articles/sql-database-configure-firewall-settings/

SQL Database uses firewall rules to allow connections to your servers and databases. You can define Server-level and Database-level firewall settings for the master or a user database in your SQL database lo Gical server to selectively allow access to the database.

We open the portal---Click enter database server---Click Settings--Show firewall

650) this.width=650; "title=" clip_image022 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image022" src= "http://s3.51cto.com/wyfs02/M01/78/BD/wKiom1aCTlCgu1EWAAGy1T_DpEE215.jpg" height= "636"/>

We click on the firewall to enter the firewall settings;

650) this.width=650; "title=" clip_image024 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image024" src= "http://s3.51cto.com/wyfs02/M00/78/BD/wKiom1aCTlGgX8zTAAFfZ1nRbn0622.jpg" height= "671"/>

Add a client IP that allows connections to the firewall rules

650) this.width=650; "title=" clip_image026 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image026" src= "http://s3.51cto.com/wyfs02/M00/78/BB/wKioL1aCTm7yeo6NAAEc8L1SwYU978.jpg" height= "677"/>

If we need to access the SQL Server server externally, we need to add the IP address of the network.

First we look at the address of the net via IP138

650) this.width=650; "title=" clip_image028 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image028" src= "http://s3.51cto.com/wyfs02/M01/78/BB/wKioL1aCTnCxCHqTAAFd7ud5iDU147.jpg" height= "310"/>

We add a user's access IP based on the information we query.

650) this.width=650; "title=" clip_image030 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image030" src= "http://s3.51cto.com/wyfs02/M01/78/BD/wKiom1aCTlXjdFYOAAEA-PHvf-o226.jpg" height= "529"/>

Add complete

650) this.width=650; "title=" clip_image032 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image032" src= "http://s3.51cto.com/wyfs02/M02/78/BD/wKiom1aCTlezihZpAAEA0mhejQM150.jpg" height= "635"/>

Once added, we connect again via SQL Server Managerstudio, and we can successfully connect

650) this.width=650; "title=" clip_image034 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image034" src= "http://s3.51cto.com/wyfs02/M00/78/BD/wKiom1aCTljj0EdbAAFYVIGLOiM680.jpg" height= "533"/>

Next we can create a database for testing

650) this.width=650; "title=" clip_image036 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image036" src= "http://s3.51cto.com/wyfs02/M01/78/BD/wKiom1aCTlqhKLCqAAEsuJdDXSU631.jpg" height= "507"/>

Creating a database and tables on Azure is done through scripting

650) this.width=650; "title=" clip_image038 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image038" src= "http://s3.51cto.com/wyfs02/M02/78/BD/wKiom1aCTlvziMvpAAGiI3IvcV4958.jpg" height= "540"/>

Let's create a database first Student

CREATE DATABASE Studentgo

Click Execute, and then create the success

650) this.width=650; "title=" clip_image040 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image040" src= "http://s3.51cto.com/wyfs02/M01/78/BB/wKioL1aCTnmCmQ31AAGUsiPEYlE191.jpg" height= "522"/>

Once created, we can look it up on the portal

650) this.width=650; "title=" clip_image042 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image042" src= "http://s3.51cto.com/wyfs02/M02/78/BB/wKioL1aCTnqjQdYJAADj3oZBa_s113.jpg" height= "466"/>

Next we create a table info

650) this.width=650; "title=" clip_image044 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image044" src= "http://s3.51cto.com/wyfs02/M00/78/BD/wKiom1aCTmHzHNN0AAI66L_B_v0987.jpg" height= "536"/>

CREATE table info (ID int primary key IDENTITY () not null,name varchar (), Sex varchar (+), age varchar (+) go

650) this.width=650; "title=" clip_image046 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image046" src= "http://s3.51cto.com/wyfs02/M01/78/BD/wKiom1aCTmOT0ewPAAI8ecxWudU723.jpg" height= "/>"

We query by query command

650) this.width=650; "title=" clip_image048 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image048" src= "http://s3.51cto.com/wyfs02/M02/78/BD/wKiom1aCTmSxeM6WAAEnhn6R25k277.jpg" height= "476"/>

We can insert data directly by inserting data into the command.

650) this.width=650; "title=" clip_image050 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image050" src= "http://s3.51cto.com/wyfs02/M00/78/BD/wKiom1aCTmbyQBqEAAGbQFeRz_o022.jpg" height= "514"/>

650) this.width=650; "title=" clip_image052 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image052" src= "http://s3.51cto.com/wyfs02/M01/78/BB/wKioL1aCToOxaHpOAAEJADiw5vE016.jpg" height= "407"/>

Insert the database, we look at the data we just inserted

650) this.width=650; "title=" clip_image054 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image054" src= "http://s3.51cto.com/wyfs02/M01/78/BD/wKiom1aCTmmQdjEFAAFdPZOrLW4765.jpg" height= "496"/>

Of course, we can also use scripts to insert data

650) this.width=650; "title=" clip_image056 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image056" src= "http://s3.51cto.com/wyfs02/M01/78/BB/wKioL1aCToajA-vaAAFNRAgSVlQ674.jpg" height= "460"/>

We make changes in the script format

650) this.width=650; "title=" clip_image058 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image058" src= "http://s3.51cto.com/wyfs02/M00/78/BB/wKioL1aCToez8DboAAD8sH5HW4U620.jpg" height= "443"/>

We'll insert a piece of data next

650) this.width=650; "title=" clip_image060 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image060" src= "http://s3.51cto.com/wyfs02/M00/78/BD/wKiom1aCTm2hmXBpAADkqFfh4e8155.jpg" height= "471"/>

After inserting using script insertion, I look at the inserted data

650) this.width=650; "title=" clip_image062 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image062" src= "http://s3.51cto.com/wyfs02/M00/78/BD/wKiom1aCTm6gD0TKAAD0kYPsFvk205.jpg" height= "517"/>

Next we look at the data with Chinese

650) this.width=650; "title=" clip_image064 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image064" src= "http://s3.51cto.com/wyfs02/M00/78/BB/wKioL1aCTouQuj0CAAEKdG6Nvhg396.jpg" height= "521"/>

When we look at it, it's displayed as garbled.

650) this.width=650; "title=" clip_image066 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image066" src= "http://s3.51cto.com/wyfs02/M02/78/BB/wKioL1aCToyjyeOhAAEGWq1Yg0E249.jpg" height= "501"/>

We check that the current database is sorted as the default, and the sort does not support Chinese sorting

650) this.width=650; "title=" clip_image068 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image068" src= "http://s3.51cto.com/wyfs02/M00/78/BB/wKioL1aCTo2xCTPLAAC6SeYgjDI915.jpg" height= "516"/>

Once you've created a database on azure, you can't change the sort, so we created a new database test and then modified the sort

650) this.width=650; "title=" clip_image070 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image070" src= "http://s3.51cto.com/wyfs02/M01/78/BB/wKioL1aCTo7gmUAGAAEs6ytV2a8460.jpg" height= "549"/>

We'll change the sort to chinese_prc_cl_as

650) this.width=650; "title=" clip_image072 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image072" src= "http://s3.51cto.com/wyfs02/M01/78/BD/wKiom1aCTnSSh44_AADMUca1n14283.jpg" height= "539"/>

After the change we insert the data again

650) this.width=650; "title=" clip_image074 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image074" src= "http://s3.51cto.com/wyfs02/M00/78/BD/wKiom1aCTnXSosCPAAETnOL6eHY493.jpg" height= "432"/>

We use commands to view; inserted Chinese data can be displayed;

650) this.width=650; "title=" clip_image076 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image076" src= "http://s3.51cto.com/wyfs02/M01/78/BB/wKioL1aCTpGRCs5vAADMZCi3yj0945.jpg" height= "456"/>

To summarize, we can view all sorts and descriptions that can be supported within the system through the following commands

SELECT * FROM:: Fn_helpcollations ()

650) this.width=650; "title=" clip_image078 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image078" src= "http://s3.51cto.com/wyfs02/M02/78/BB/wKioL1aCTpWQge6-AANCN_5hFXE987.jpg" height= "591"/>

If you view the sorting of the current database

SELECT [Name],[collation_name] from SYS. DATABASES

650) this.width=650; "title=" clip_image080 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;margin:0px;padding-right:0px; "border=" 0 "alt = "clip_image080" src= "Http://s3.51cto.com/wyfs02/M02/78/BB/wKioL1aCTpaTSVWKAAFvHePVeGA776.jpg" height= "520"/>

Modify sorting is not supported on azure, so you can only delete after re-database

ALTER DATABASE <databasename> COLLATE chinese_prc_ci_as

650) this.width=650; "title=" clip_image082 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;padding-right:0px, "border=" 0 "alt=" clip_ image082 "src=" http://s3.51cto.com/wyfs02/M00/78/BD/wKiom1aCTnyzw_TTAAFtvkfSxkc838.jpg "height=" 383 "/>

This article from "Gao Wenrong" blog, declined reprint!

Create, configure, and manage SQL Server information on Global Azure

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.