0

I have two computers located at two stores. One is with the ip 192.168.10.100, another is with the ip 192.68.10.200. Both computers has database have database: StoreInformation. Both databases have table: Inventory. Both tables have ItemNum, ItemDescription, and Quantity.

I want to sum the total of quantity for each individual items on both tables.

Eg.
Store1->StoreInformation->Inventory

ItemNum ItemDescription Quantity
000001  Apple           10
000002  Pear            15

Store2->StoreInformation->Inventory

ItemNum ItemDescription Quantity
000001  Apple           8
000002  Pear            21

I want to result to show:

ItemNum ItemDescription Quantity
000001  Apple           18
000002  Pear            36


Thank you for your help in advance.

Mike Aguilar
  • 348
  • 2
  • 3
  • 14
Kenneth
  • 23
  • 3
  • What have you tried so far??? – Eric May 09 '18 at 23:02
  • I just have the thought of using query. Currently I export the tables to excel and use excel formula to get the result. – Kenneth May 09 '18 at 23:06
  • 3
    create a linked server and join the two tables – RoMEoMusTDiE May 09 '18 at 23:40
  • 1
    Here's an [SO Answer](https://stackoverflow.com/questions/10402197/how-to-create-the-linked-server-for-sql-server-2008-where-we-have-the-database-f) regarding linked servers in SQL Server 2008. Once they're linked you'll be able to link/union tables in both databases. – anu start May 09 '18 at 23:53
  • Thank you very much. Link server works great. It solves my problem. – Kenneth May 10 '18 at 03:03

0 Answers0