How to updating Address as an xml datatype value in a table using a procedure?

Merryj
Posted by Merryj under Sql Server category on | Points: 40 | Views : 1470
Create procedure [dbo].[updating]
@id int
as
begin
SELECT
FirstName,
LastName,
Person_Address.value('(/person//HouseName/node())[1]', 'nvarchar(max)') as HouseName,
Person_Address.value('(/person//HouseNumber/node())[1]', 'nvarchar(max)') as HouseNumber,
Person_Address.value('(/person//City/node())[1]', 'nvarchar(max)') as City,
Person_Address.value('(/person//PO/node())[1]', 'nvarchar(max)') as PO,
Person_Address.value('(/person//Pin/node())[1]', 'nvarchar(max)') as Pin,
Person_Address.value('(/person//State/node())[1]', 'nvarchar(max)') as Person_State from tblPerson
where Person_Id=@id
end

Comments or Responses

Posted by: T.saravanan on: 4/28/2011 Level:Silver | Status: [Member] [MVP] | Points: 10
Hi,

Kindly post your code inside the code tag.What is the use of this code, could you little bit explain its really useful to users.

Login to post response