艾榕@编程的乐趣 享受编程,享受生活

4一/100

今日嘀咕(2010.01.03-01.04)

哭,并不代表我屈服;退一步,并不象征我认输; 放手,并不表示我放弃;微笑,并不意味我快乐 2010-01-03 12:39:11 Read more...

7十二/090

How to use Sql Azure

Description:
Sql Azure is the cloud computing service provided by Microsoft, which is @CTP version now.  Sql Azure will provide you databases on the cloud level, this means you can host your data on the MS’s database server, definitely, it will be more safety.
Apply for an Sql Azure account:
Even Sql Azure is @CTP, but your still need to use a activation code to get an Azure account,  go to https://sql.azure.com and apply for an account, you will probably get your activation code after several hours.
Create an databaseGo to https://sql.azure.com and login with your username, click on the “Create Database”  button to create a new database, in this document, I will use the “FirstTestDb”  as my demo database name.
Connect to Sql Azure from the command lineBefore connect to Sql Azure, you need to get the following from your Sql Azure portal page:
Server: which is of format ****.database.windows.netServerName: which is the first part of the Server.
Username: the administrator name when your active your Sql Azure account.
Password: the password when you active your Sql Azure account.
For example: my server is fx50bskenx.database.windows.net, so my server name is fx50bskenx,  my username is wlmzfxType sqlcmd -S fx50bskenx.database.windows.net -U wlmzfx@fx50bskenx -d FirstTestDb at your command line, and then type your password, once you see the 1> from your command window, that means you have connected to Sql Azure successfully.
Note: Sql Azure does not support USE databasename command for the moment, so you need to specify your database when typing the command.
Execute Sql command against Sql AzureCreate a new table Person:
1> CREATE TABLE Person (Id INT IDENTITY(0,1) PRIMARY KEY, FirstNameNVARCHAR(50))2> GOInsert a new row to the Person table:
1> INSERT INTO Person (FirstName) VALUES(N'Wang Pan');2> GONote: type one more GO at a new line at the end of your command, I have tried to use ; to specified end of and command, but it does not work.

Description:

Sql Azure is the cloud computing service provided by Microsoft, which is @CTP version now.  Sql Azure will provide you databases on the cloud level, this means you can host your data on the MS’s database server, definitely, it will be more safety. Read more...