Este tema aún no ha recibido ninguna valoración - Valorar este tema

Create Table

The Create Table operation creates a new table in the storage account.

The Create Table request may be constructed as follows. Replace myaccount with the name of your storage account:

 

Method Request URI HTTP Version

POST

http://myaccount.table.core.windows.net/Tables

HTTP/1.1

When making a request against the local storage service, specify the local hostname and Table service port as 127.0.0.1:10002, followed by the local storage account name:

 

Method Request URI HTTP Version

POST

http://127.0.0.1:10002/devstoreaccount1/Tables

HTTP/1.1

The Table service in the storage emulator differs from the Windows® Azure™ Table service in several ways. For more information, see Información general del emulador de almacenamiento de Windows Azure and Diferencias entre el emulador de almacenamiento y los servicios de almacenamiento de Windows Azure.

The following table describes required and optional request headers.

 

Request header Description

Authorization

Required. Specifies the authentication scheme, account name, and signature. For more information, see Authentication Schemes.

Date or x-ms-date

Required. Specifies the Coordinated Universal Time (UTC) for the request. For more information, see Authentication Schemes.

x-ms-version

Optional. Specifies the version of the operation to use for this request. For more information, see Storage Services Versioning.

Content-Type

Required. The content type of the request body. Currently, this header should be set to application/atom+xml.

Content-Length

Required. The length of the request body.

The request body specifies the name of the table to be created. Note that table names must conform to the naming restrictions described in Understanding the Table Service Data Model.

The request body is an ADO.NET entity set, which is an Atom feed. It has the following general format.

<?xml version="1.0" encoding="utf-8" standalone="yes"?>   
  <entry xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" 
    xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata
    xmlns="http://www.w3.org/2005/Atom"> 
    <title /> 
    <updated>2009-03-18T11:48:34.9840639-07:00</updated> 
    <author>
      <name/> 
    </author> 
      <id/> 
      <content type="application/xml">
        <m:properties>
          <d:TableName>mytable</d:TableName>
        </m:properties>
      </content> 
    </entry>

For further details about the specification for the Atom feed, see the Atom Serialization Rules (ADO.NET Data Services Framework) in the ADO.NET Data Service Specifications.

The response includes an HTTP status code, a set of response headers, and a response body.

A successful operation returns status code 201 (Created).

For information about status codes, see Status and Error Codes and Table Service Error Codes.

The response for this operation includes the following headers. The response may also include additional standard HTTP headers. All standard headers conform to the HTTP/1.1 protocol specification.

 

Response header Description

x-ms-request-id

This header uniquely identifies the request that was made and can be used for troubleshooting the request. For more information, see Troubleshooting API Operations.

x-ms-version

Indicates the version of the Table service used to execute the request. This header is returned for requests made against version 2009-09-19 and later.

Date

A UTC date/time value generated by the service that indicates the time at which the response was initiated.

The response body is also an ADO.NET entity set.

Here is a sample XML response for the Create Table operation.

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<entry xml:base="http://myaccount.table.core.windows.net/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom"> <id>http://myaccount.table.core.windows.net/Tables('mytable')</id>
  <title type="text"></title>
  <updated>2009-01-04T17:18:54.7062347Z</updated>
  <author>
    <name />
  </author>
  <link rel="edit" title="Tables" href="Tables('mytable')" />
  <category term="myaccount.Tables" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
  <content type="application/xml">
    <m:properties>
      <d:TableName>mytable</d:TableName>
    </m:properties>
  </content>
</entry>

Only the account owner may call this operation.

¿Te ha resultado útil?
(Caracteres restantes: 1500)

Adiciones de comunidad

© 2013 Microsoft. Reservados todos los derechos.
facebook page visit twitter rss feed newsletter