Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

SQL Query to find the Delta between 2 rows

$
0
0

Can the below be possible? If so can you help me writing a dynamic SQL Query to do so…

I have data in spreadsheet which is pulled off from the database (data from more than one table with joins); send it to the different teams. They will check the data n update the spreadsheet if necessary and send it back to me.

I have to find the changes and update the database from the provided spreadsheet accordingly. Changes can be on different columns on each set of row.

Example:

DataFrom

ServerName

Branch_Name

Application_Name

Server Status

Application_Status

App_Environment

Tier

SQL Query

abcdef

app

adp

Deployed

Deployed

Production

silver

Excel

abcdef

app

adp

Deployed

Deployed

Development

Bronze

DataFrom

ServerName

Branch_Name

Application_Name

Server Status

Application_Status

App_Environment

Tier

SQL Query

Hijkl

app

adp

Deployed

Deployed

Production

Gold

Excel

Hijkl

app

Dep

Deployed

Deployed

Production

Gold

DataFrom

ServerName

Branch_Name

Application_Name

Server Status

Application_Status

App_Environment

Tier

SQL Query

Xzy

app

Dep

Deployed

Deployed

Production

Silver

Excel

Xzy

App

Dep

Deployed

Deployed

Development

Silver

Above scenario is an example what I am look to do with sql script? Opinions/queries accepted…

There are 1200+ rows to compare it manually which is a pain.

Thanks.


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>