A database can be created through the Windows Azure Management Portal. You navigate to your Windows Azure SQL Database instance and through Data Services --> SQL Database --> Quick Create you can easily create a database.
Figure 1. Create a database through Windows Azure Management Portal.
Figure 2. Provision of a database (click to enlarge).
Figure 3. Manage the database (click to enlarge).
Figure 4. Manage url of the database (click to enlarge).
Figure 5. Silverlight portal of Windows Azure SQL Database
CREATE TABLE [dbo].[Employee]( [Employee_ID] [int] IDENTITY(10001,1) NOT NULL, [Name] [varchar](50) NOT NULL, [DOJ] [datetime] NULL, [Designation] [varchar](50) NOT NULL, [Job_Description] [varchar](max) NULL, [Photo] [image] NULL, [Salary] [decimal](18, 2) NOT NULL, [Last_Modified] [timestamp] NULL, [Status] [int] NULL CONSTRAINT [DF_Employee_Status] DEFAULT ((0)), [Address] [xml] NULL, CONSTRAINT [PK_Employee] PRIMARY KEY CLUSTERED ( [Employee_ID] ASC )) GO
CREATE
TABLE
[dbo].[Employee](
[Employee_ID] [
int
] IDENTITY(10001,1)
NOT
NULL
,
[
Name
] [
varchar
](50)
[DOJ] [datetime]
[Designation] [
[Job_Description] [
](
max
)
[Photo] [image]
[Salary] [
decimal
](18, 2)
[Last_Modified] [
timestamp
]
[Status] [
CONSTRAINT
[DF_Employee_Status]
DEFAULT
((0)),
[Address] [xml]
[PK_Employee]
PRIMARY
KEY
CLUSTERED
(
[Employee_ID]
ASC
))
GO
Figure 6. Executing a TSQL statement in Windows Azure SQL Database Portal.
INSERT INTO [Employee]([Name],[Designation],[Salary])VALUES('Jeff Price','Manager',500000) INSERT INTO [Employee]([Name],[Designation],[Salary])VALUES('Don Hall','Accountant',40000) INSERT INTO [Employee]([Name],[Designation],[Salary])VALUES('Keith Harris','Supervisor',300000) INSERT INTO [Employee]([Name],[Designation],[Salary])VALUES('Jim Hance','Admin',200000) INSERT INTO [Employee]([Name],[Designation],[Salary])VALUES('Andy Jacobs','Accountant',400000)
INSERT
INTO
[Employee]([
],[Designation],[Salary])
VALUES
'Jeff Price'
'Manager'
,500000)
'Don Hall'
'Accountant'
,40000)
'Keith Harris'
'Supervisor'
,300000)
'Jim Hance'
'Admin'
,200000)
'Andy Jacobs'
,400000)
CREATE PROCEDURE [dbo].[ADD_EMP_DETAILS] -- Add the parameters for the stored procedure here @emp_name varchar(50), @emp_desig varchar(50), @salary decimal(18,2) AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -- Insert statements for procedure here INSERT INTO [Employee] ([Name] ,[Designation] ,[Salary]) VALUES (@emp_name ,@emp_desig ,@salary) SELECT [Employee_ID] FROM Employee where [Employee_ID] = (select IDENT_CURRENT('Employee')) END GO
PROCEDURE
[dbo].[ADD_EMP_DETAILS]
-- Add the parameters for the stored procedure here
@emp_name
(50),
@emp_desig
@salary
(18,2)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET
NOCOUNT
ON
;
-- Insert statements for procedure here
[Employee]
([
,[Designation]
,[Salary])
(@emp_name
,@emp_desig
,@salary)
SELECT
FROM
Employee
where
[Employee_ID] = (
select
IDENT_CURRENT(
'Employee'
END
CREATE PROCEDURE [dbo].[GET_EMP_DETAILS_BY_NAME] -- Add the parameters for the stored procedure here @emp_name varchar(50) AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -- Insert statements for procedure here SELECT * FROM [Employee] WHERE [Name] = @emp_name END GO
[dbo].[GET_EMP_DETAILS_BY_NAME]
(50)
*
WHERE
] = @emp_name
Figure 7. Add generated items - Consume Adapter Service
Picture 8. Configure adapter - Security.
Picture 9. Configure adapter - URI Properties.
Figure 10. Connect to Windows Azure SQL Database.
Figure 11. Select Stored procedures.
Figure 11. Adding the procedures.
Figure 12. Stored Procedure schemas (click to enlarge).
Figure 13. Orchestration calling a stored procedure (click to enlarge).
Figure 14. WCF-Custom Transport Properties.
Figure 15. Orchestration bindings.
Figure 16. WCF-Custom Transport Properties
<ns0:ADD_EMP_DETAILS xmlns:ns0="http://schemas.microsoft.com/Sql/2008/05/Procedures/dbo"> <ns0:emp_name>Joe Davis</ns0:emp_name> <ns0:emp_desig>Accountant</ns0:emp_desig> <ns0:salary>79000</ns0:salary> </ns0:ADD_EMP_DETAILS>
<
ns0:ADD_EMP_DETAILS
xmlns:ns0
=
"http://schemas.microsoft.com/Sql/2008/05/Procedures/dbo"
>
ns0:emp_name
>Joe Davis</
ns0:emp_desig
>Accountant</
ns0:salary
>79000</
</
<ADD_EMP_DETAILSResponse xmlns="http://schemas.microsoft.com/Sql/2008/05/Procedures/dbo"> <ADD_EMP_DETAILSResult> <DataSet xmlns="http://schemas.datacontract.org/2004/07/System.Data"><xs:schema id="NewDataSet" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xs:element msdata:IsDataSet="true" name="NewDataSet"> <xs:complexType><xs:sequence><xs:element minOccurs="0" maxOccurs="unbounded" name="NewTable"><xs:complexType><xs:sequence><xs:element minOccurs="0" name="Employee_ID" type="xs:int" /></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element></xs:schema><diffgr:diffgram xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"><NewDataSet xmlns=""> <NewTable><Employee_ID>10006</Employee_ID> </NewTable> </NewDataSet> </diffgr:diffgram> </DataSet> </ADD_EMP_DETAILSResult> <ReturnValue>0</ReturnValue></ADD_EMP_DETAILSResponse>
ADD_EMP_DETAILSResponse
xmlns
> <
ADD_EMP_DETAILSResult
DataSet
"http://schemas.datacontract.org/2004/07/System.Data"
><
xs:schema
id
"NewDataSet"
xmlns:xs
"http://www.w3.org/2001/XMLSchema"
xmlns:msdata
"urn:schemas-microsoft-com:xml-msdata"
xs:element
msdata:IsDataSet
"true"
name
xs:complexType
xs:sequence
minOccurs
"0"
maxOccurs
"unbounded"
"NewTable"
"Employee_ID"
type
"xs:int"
/></
></
diffgr:diffgram
xmlns:diffgr
"urn:schemas-microsoft-com:xml-diffgram-v1"
NewDataSet
""
NewTable
Employee_ID
>10006</
> </
ReturnValue
>0</
<ns0:GET_EMP_DETAILS_BY_NAME xmlns:ns0="http://schemas.microsoft.com/Sql/2008/05/Procedures/dbo"> <ns0:emp_name>Joe Davis</ns0:emp_name> </ns0:GET_EMP_DETAILS_BY_NAME>
ns0:GET_EMP_DETAILS_BY_NAME
<GET_EMP_DETAILS_BY_NAMEResponse xmlns="http://schemas.microsoft.com/Sql/2008/05/Procedures/dbo"><GET_EMP_DETAILS_BY_NAMEResult> <DataSet xmlns="http://schemas.datacontract.org/2004/07/System.Data"><xs:schema id="NewDataSet" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"><xs:element msdata:IsDataSet="true" name="NewDataSet"><xs:complexType><xs:sequence><xs:element minOccurs="0" maxOccurs="unbounded" name="NewTable"><xs:complexType><xs:sequence><xs:element minOccurs="0" name="Employee_ID" type="xs:int" /><xs:element minOccurs="0" name="Name" type="xs:string" /><xs:element minOccurs="0" name="DOJ" type="xs:dateTime" /><xs:element minOccurs="0" name="Designation" type="xs:string" /><xs:element minOccurs="0" name="Job_Description" type="xs:string" /><xs:element minOccurs="0" name="Photo" type="xs:base64Binary" /><xs:element minOccurs="0" name="Salary" type="xs:decimal" /><xs:element minOccurs="0" name="Last_Modified" type="xs:base64Binary" /><xs:element minOccurs="0" name="Status" type="xs:int" /><xs:element minOccurs="0" name="Address" type="xs:string" /></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element></xs:schema><diffgr:diffgram xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"><NewDataSet xmlns=""><NewTable><Employee_ID>10006</Employee_ID><Name>Joe Davis</Name><Designation>Accountant</Designation><Salary>79000.00</Salary><Last_Modified>AAAAAAAAAAY=</Last_Modified><Status>0</Status></NewTable></NewDataSet></diffgr:diffgram></DataSet></GET_EMP_DETAILS_BY_NAMEResult> <ReturnValue>0</ReturnValue></GET_EMP_DETAILS_BY_NAMEResponse>
GET_EMP_DETAILS_BY_NAMEResponse
GET_EMP_DETAILS_BY_NAMEResult
/><
"Name"
"xs:string"
"DOJ"
"xs:dateTime"
"Designation"
"Job_Description"
"Photo"
"xs:base64Binary"
"Salary"
"xs:decimal"
"Last_Modified"
"Status"
"Address"
Designation
Salary
>79000.00</
Last_Modified
>AAAAAAAAAAY=</
Status
Read suggested related topics: