I knew Windows Azure SQL Databases have been around for a couple of years but never had the time or need to research them. With a possible data center consolidation in the future, I was wondering if my company could leverage a Windows Azure SQL Databases to reduce the total cost of ownership for certain applications?
Today, I will be working with the sample [AUTOS] cloud database that I created in a previous blog. I want to test connectivity to this cloud database using common programs and tools that my users or developers might choose.
A command line tool like SQLCMD can be used to issue most, if not all TSQL commands. It is great for ad-hoc queries with small result sets.
This includes Data Manipulation Language (DML) commands to SELECT, INSERT, UPDATE, and DELETE data.
The command file below connects to the [AUTOS] database in the cloud, executes the commands in the input file, and saves any results to the output file. I was able to successfully run the above commands.
Another good test for SQLCMD is to execute Data Definition Commands to CREATE TABLE, ALTER TABLE, and DROP TABLE.
The command file below connects to the [AUTOS] database in the cloud, executes the commands in the input file, and saves any results to the output file.
I was able to add a new table named [STAGE].[MAKES] with constraints and keys. I loaded the table with data from the staging scheme and displayed the current state of the table. Last but not least, I removed the table at the end of script.
I ran this script one more time to have a table to use in my BCP example. A cool thing out BCP is that it can be used to load or dump data.
The example below has a command file that dumps the contents of the [STAGE].[MAKES] to a local Comma Separated Values (CSV) file.
In a nutshell, the command line utilities that can be downloaded as part of the feature pack work fine with an Azure SQL database. Just make sure you have the user name, password, and connection information entered in correctly. These utilities use the SQL Native driver to talk to the cloud.
Next time, we will explore what can be done with MS Access using an ODBC connection to talk to our Azure SQL database.
March 2014 M T W T F S S « Feb 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Cloud TagsALTER TABLE ALTER TRIGGER BEGIN CREATE DATABASE create function create procedure CREATE TABLE create trigger create view database administrator database developer DATEPART date time functions DDL DECLARE DELETE DROP TRIGGER DROP VIEW EXISTS FORMAT free code IF INSERT ISNULL John F. Miner III math function PASS perl script Presentation PRINT REPLACE SELECT sp_help sp_helptext SQL Server SQL Server Management Studio SSMS. string function sys.objects TRIGGERS TRUNCATE TABLE TSQL UPDATE vb script while