SQL Azure… Yep, that is SQL Server on the Cloud!
A few days ago I received my SQL Azure (CTP) invitation code. The first thing I naturally did right after this was to create and access a database on the Cloud! I was very curious to see how I could interact with a database hosted on the cloud.
After getting access to the SQL Azure Service (you can register for the CTP here), you can easily create a database by clicking on the “Create Database” button.
The default database is the well-known “master” database.
I called the database I created “sqlazure”.
So, an empty database is created, what next? One of the options is to connect to the database using SQL Server 2008 Management Studio (SSMS)!
I will provide the procedure I followed (with screenshots) in steps:
Step 1
Select the database hosted on the cloud in SQL Azure and click on the “Connection Strings” button:
When clicking on that button you will get three connection strings for the following:
- ADO .NET
- ODBC
- OLE DB
In all the connection strings, you can find the same server value in the form of Server=tcp:[full_server_name]. Note down the full server name or just copy it to your Windows clipboard.
Step 2
Start SQL Server 2008 Management Studio (SSMS).
On the connection dialog that appears when starting SSMS, click on the “Cancel” button.
Step 3
In SSMS click on “New Query”. The connection dialog appears again.
On the connection dialog enter the following information:
- Server Name: The full server name as provided by the SQL Azure connection string.
- Authentication: SQL Server Authentication.
- Login: The SQL Azure server admin username.
- Password: The SQL Azure server admin password.
Also, before clicking the “Connect” button, click on “Options” and under the “Connection Properties” tab, in the “Connect to database” field, enter the database name which is hosted on the cloud and you want to access*.
* In this case you have to note that if you do not specify the database in the connection properties, you will be automatically connected to the “master” database. Though, once connected to a database on SQL Azure, it is not yet possible to use the “USE” command for switching to another database. The only way for switching to another database, is to establish a new connection on that database.
OK, after selecting the database on which you want to connect (in this example sqlazure) click on the “Connect” button.
By the way, you will get an error message about ANSI_NULLS but you can ignore this and continue.
That’s it! You are now connected to your database hosted on the cloud and you can issue queries using SSMS query window!
Step 4
Finally, let’s run some queries against our database:
-- Create a table CREATE TABLE CLOUD_MSGS( msgID int, msgDescr varchar(100) ) GO -- Create unique clustered index CREATE UNIQUE CLUSTERED INDEX msgID_ind ON CLOUD_MSGS (msgID) GO -- Populate table with data ... using Row Constructors! :) INSERT INTO CLOUD_MSGS(msgID,msgDescr) VALUES (1,'Welcome to SQL Azure'), (2,'Hello World!'), (3,'SQL is on the Cloud!') GO -- Display the contents of the "CLOUD_MSGS" table SELECT * FROM CLOUD_MSGS
Resources
Below you can find some useful resources regarding SQL Azure. Note that this is pre-release documentation and is subject to change in future releases:
Upgrade your Tech Skills – Learn all about Azure SQL Database
Enroll to our online course on Udemy titled “Introduction to Azure SQL Database for Beginners” and get lifetime access to high-quality lessons and hands-on guides about all aspects of Azure SQL Database.
Learn More
Featured Online Courses:
- Introduction to Azure SQL Database for Beginners
- SQL Server 2019: What’s New – New and Enhanced Features
- SQL Server Fundamentals – SQL Database for Beginners
- Essential SQL Server Administration Tips
- Boost SQL Server Database Performance with In-Memory OLTP
- Essential SQL Server Development Tips for SQL Developers
- Working with Python on Windows and SQL Server Databases
- Introduction to Computer Programming for Beginners
- .NET Programming for Beginners – Windows Forms with C#
- Introduction to SQL Server Machine Learning Services
- Entity Framework: Getting Started – Complete Beginners Guide
- How to Import and Export Data in SQL Server Databases
- Learn How to Install and Start Using SQL Server in 30 Mins
- A Guide on How to Start and Monetize a Successful Blog
Read Also:
- Essential SQL Server Development Tips for SQL Developers
- The TempDB System Database in SQL Server
- SQL Server Installation and Setup Best Practices
- The feature you are trying to use is on a network resource that is unavailable
- SQL Server 2016: TempDB Enhancements
- tempdb growth
- Introduction to SQL Server Machine Learning Services
- Essential SQL Server Administration Tips
- What are SQL Server Statistics and Where are they Stored?
- Check all our Weekly Tips!
Subscribe to our newsletter and stay up to date!
Subscribe to our YouTube channel (SQLNetHubTV)!
Like our Facebook Page!
Check our SQL Server Administration articles.
Check out our latest software releases!
Check our eBooks!
Rate this article:
Reference: SQLNetHub.com (https://www.sqlnethub.com)
© SQLNetHub
Artemakis Artemiou is a seasoned Senior Database and AI/Automation Architect with over 20 years of expertise in the IT industry. As a Certified Database, Cloud, and AI professional, he has been recognized as a thought leader, earning the prestigious Microsoft Data Platform MVP title for nine consecutive years (2009-2018). Driven by a passion for simplifying complex topics, Artemakis shares his expertise through articles, online courses, and speaking engagements. He empowers professionals around the globe to excel in Databases, Cloud, AI, Automation, and Software Development. Committed to innovation and education, Artemakis strives to make technology accessible and impactful for everyone.