Monday, August 10, 2009

Query XML Data in Sql 2005

1. Sql Server 2005 includes subset of the XQuery language

2. Xquery is a language for query data stored using Xml Data Type

3. DDL operation on xml column

Syntax to retrieve a date from a column of xml data type<
Select columnname .query (‘/nodename’) from TableName
Select columname .query (‘/nodename/childnodename’) from TableName
Note: other clause of select such as ’ where’ clause can be use in above
statements and column should be xml type nodename refer to element name
4. DML operation on Xml



* INSERT


Syntax : Insert into tablename (columname,Xmlcolumname) values (1
,”Xquery”)
Note :xmlcolumn name can be second or third column according to table definition and valid xml data should be inserted in xml column

* UPDATE


I)as first II) as last III)into Iv)after V)before VI)Delete VII)Replace value of

As Last & As First

Syntax:Update table name set columnname.modify(‘insert microsoft
as last into (/book[1]) ’)
Note: as last and as first same syntax .column should be xml type

After & before

Syntax:Update table name set columname.modify(‘insert james
after into (book /pubs[1]) ’)
Note: after and before same syntax .column should be xml type

Delete

Syntax:Update table name set columname.modify(‘ delete /book/pubs/auother ’)
Note:Enter element name with path colum should be xml type

Replace value of particular element

Syntax:Update table name set columname.modify(‘ replace value of
(book /pubs/text())[1] with ‘‘sql’’ ’)
Note:Enter element name with path colum & text() colum should be xml type


Refered links
http://msdn.microsoft.com/en-us/library/ms345122(SQL.90).aspx
http://msdn.microsoft.com/en-us/library/ms971534.aspx
http://msdn.microsoft.com/en-us/library/ms345117.aspx
http://blogs.msdn.com/mrorke/archive/2005/04/13/407921.aspx

new Features of Asp.net 3.5

# Asp.net Ajax is integerated in to dot netframwork

# Asp.net Ajax control extender can be added to toolbox vs2008

# Listview and datapager are new controls are added

# New Data source control is added called as Linq DataSource

# LINQ(language Integrated query) add native date query capapbilty to c#.net

# WCF Support for RSS, JSON, POX and Partial Trust

# Asp.net 3.5 include a new mergertool(aspnet_merge.exe).it comination and manage assemblies created by aspnet_compiler.exe(In older version it is avilable as addon)

# new Assemblies 3.5


1. System.core.dll-Includes the implementation for LINQ to objects

2. System.data.linq.dll-Include the implementaion for LINQ to SQL

3. System.Xml.Linq.dll-Include the implementation for LINQ to XMl

4. System.Date.DatsetExtension.dll-Includes implementation for LINQ to DataSet


# Asp.net 3.5 provide bettter support iis7 , iis7 Asp.net 3.5 modules and handles support unified configuration

# vs2002 worked with asp.net 1.0,vs2003 worked with Asp.net 1.1 and vs2005 worked with Asp.net 2.0 and Vs2008 support multiTargetting i.e it works with Asp.net 2.0 and Asp.net 3.5

Differencce between .net 2.0 ,3.0,3.5

Differencce between .net 2.0 ,3.0,3.5
.NET 2.0

CLR VERSION 2.0
FRMEWORK LIBRARIES : .NETfx 2.0
LANGUAGE : C# 2.0 VB 8.0
• A new hosting API for native applications wishing to host an instance of the .NET runtime
• Full 64-bit support for both the x64 and the IA64 hardware platforms.
• Language support for Generics built directly into the .NET CLR.
• Many additional and improved ASP.NET web controls.
• New data controls with declarative data binding.
• New personalization features for ASP.NET, such as support for themes, skins and webparts.

.NET 3.0

CLR VERSION 2.0
FRMEWORK LIBRARIES : .NETfx 3.0
LANGUAGE : C# 2.0 VB 8.0
• Windows Presentation Foundation (WPF), formerly code-named Avalon; a new user interface subsystem and API based on XML and vector graphics, which will make use of 3D computer graphics hardware and Direct3D technologies.
• Windows Communication Foundation (WCF), formerly code-named Indigo; a service-oriented messaging system which allows programs to interoperate locally or remotely similar to web services.
• Windows Workflow Foundation (WWF) allows for building of task automation and integrated transactions using workflows.
• Windows CardSpace (WCS), formerly code-named InfoCard; a software component which securely stores a person's digital identities and provides a unified interface for choosing the identity for a particular transaction, such as logging in to a website.

.NET 3.5

CLR VERSION 2.0
FRMEWORK LIBRARIES : .NETfx 3.5
LANGUAGE : C# 3.0 VB 9.0
.NET 2.0 contains CLR.WINFORMS,ASPNET
.NET 3.0 contains complete .net 2.o and WCF,WPF,WF,CARD SPACE
.NET 3.5 contains complete .net 3.0 and LINQ , AJAX
langauage integrty query (LINQ): it is microsoft .net framwork component adds data native querying capabilities to .net languages using systnax reminiscent of sql