Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > microsoft.public.sqlserver.programming > #31260

Re: Two XML data compare(for logging)

Newsgroups microsoft.public.sqlserver.programming
Date 2015-07-07 16:57 -0700
References <efbd7296-7356-486b-8c51-0c7533f27309@googlegroups.com> <XnsA4D11D28C806Yazorman@127.0.0.1>
Message-ID <1b951ccb-c1fd-4226-8005-96589633a3e1@googlegroups.com> (permalink)
Subject Re: Two XML data compare(for logging)
From Vedat Pala <vedatpala@gmail.com>

Show all headers | View raw


8 Temmuz 2015 Çarşamba 01:10:49 UTC+3 tarihinde Erland Sommarskog yazdı:
> Vedat Pala (vedatpala@gmail.com) writes:
> > I just want to see changing values.
> > 
> > I have got 3  fields. 
> > 1.field [OldContent] [xml] NULL, 
> > 2.field [NewContent] [xml] NULL, 
> > 3.fiedl [UpdateContent] [xml] NULL, 
> > 
> > I want to compare the data in two fields. 
> > Results I want to write to the 3.field.([OldContent]) 
> > 
> > How can I do it in SQL server? 
> > 
> 
> Please check your previous thread to which I posted a solution.

The solution is not complete enough  because;
DECLARE @old xml = '<row GUEST_ID="14" GUEST_NAME="VEDAT" />', 
        @new xml = '<row GUEST_ID="14" GUEST_NAME="VEDAT35" GUEST_SURNAME="PALA" />" '

your  result only 
<row GUEST_SURNAME="PALA"
but true result
GUEST_NAME="VEDAT35" GUEST_SURNAME="PALA" 
why
old value vedat---> new value(updated)   VEDAT35
old value SURNAME=''  new value(updated)  'PALA'

Back to microsoft.public.sqlserver.programming | Previous | Next | Find similar


Thread

Re: Two XML data compare(for logging) Vedat Pala <vedatpala@gmail.com> - 2015-07-07 16:57 -0700

csiph-web