Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
[COLOR=blue]Declare[/color] @Table1 [COLOR=blue]Table[/color](Col1 [COLOR=blue]int[/color], col2 [COLOR=blue]varchar[/color](20))
[COLOR=blue]Insert[/color] [COLOR=blue]Into[/color] @Table1 [COLOR=blue]Values[/color](1, [COLOR=red]'orange'[/color])
[COLOR=blue]Insert[/color] [COLOR=blue]Into[/color] @Table1 [COLOR=blue]Values[/color](2, [COLOR=red]'purple'[/color])
[COLOR=green]--Insert Into @Table1 Values(4, 'blue')
[/color]
[COLOR=blue]Declare[/color] @Table2 [COLOR=blue]Table[/color](Col1 [COLOR=blue]int[/color], col2 [COLOR=blue]varchar[/color](20))
[COLOR=blue]Insert[/color] [COLOR=blue]Into[/color] @Table2 [COLOR=blue]Values[/color](1, [COLOR=red]'orange'[/color])
[COLOR=blue]Insert[/color] [COLOR=blue]Into[/color] @Table2 [COLOR=blue]Values[/color](2, [COLOR=red]'purple'[/color])
[COLOR=green]--Insert Into @Table2 Values(3, 'green')
[/color]
[COLOR=blue]If[/color] Exists(
[COLOR=blue]Select[/color] *
[COLOR=blue]From[/color] (
[COLOR=blue]Select[/color] checksum(*) [COLOR=blue]As[/color] A
[COLOR=blue]From[/color] @Table1
) [COLOR=blue]As[/color] T1
[COLOR=blue]Full[/color] [COLOR=blue]Join[/color] (
[COLOR=blue]Select[/color] Checksum(*) [COLOR=blue]As[/color] A
[COLOR=blue]From[/color] @Table2
) [COLOR=blue]As[/color] T2
[COLOR=blue]On[/color] T1.A = T2.A
[COLOR=blue]Where[/color] T1.A [COLOR=blue]Is[/color] NULL Or T2.A [COLOR=blue]Is[/color] NULL
)
[COLOR=blue]Begin[/color]
[COLOR=blue]Select[/color] [COLOR=red]'Tables Are Different'[/color]
[COLOR=blue]End[/color]
[COLOR=blue]Else[/color]
[COLOR=blue]Begin[/color]
[COLOR=blue]Select[/color] [COLOR=red]'Tables are the same'[/color]
[COLOR=blue]End[/color]
select * from (
select * from tableA
union all select * from tableB
) X
group by {allcolumns}
having count(*) = 1
select * from (
select * from tableA
union select * from tableB
) X
group by {primarykey}
having count(*) = 2