I have a view which has the following fields:
SiteID, CompanyID, SiteAddress1, SiteAddress2 , SiteAddress3
===== ========= ===== ========== ========== ==========
76724 , 1202 ,Devonshire Square , 3- 11 Devonshire Square, London
79007 ,1000 , A house, Somewhere, London
76724 , 904 ,Devonshire Square , 3- 11 Devonshire Square, London
The view itself is made from two tables sites and companies. A site can belong to more than one customer, as above. This view is used by a web application, to import sites and companies, but unfortunately the web application is not structured to deal with more than 1 site per company. The only way (so I have been told) is to create a unique SiteID record for each company in the view.
So using the above example the view should be like
SiteID, CompanyID, SiteAddress1, SiteAddress2 , SiteAddress3
===== ========= ===== ========== ========== ==========
767241 , 1202 ,Devonshire Square , 3- 11 Devonshire Square, London
79007 ,1000 , A house, Somewhere, London
767242 , 904 ,Devonshire Square , 3- 11 Devonshire Square, London
The question I have is there any way I can generate a unique value in the SiteID column based on the existing SiteID and CompanyID ?
SiteID, CompanyID, SiteAddress1, SiteAddress2 , SiteAddress3
===== ========= ===== ========== ========== ==========
76724 , 1202 ,Devonshire Square , 3- 11 Devonshire Square, London
79007 ,1000 , A house, Somewhere, London
76724 , 904 ,Devonshire Square , 3- 11 Devonshire Square, London
The view itself is made from two tables sites and companies. A site can belong to more than one customer, as above. This view is used by a web application, to import sites and companies, but unfortunately the web application is not structured to deal with more than 1 site per company. The only way (so I have been told) is to create a unique SiteID record for each company in the view.
So using the above example the view should be like
SiteID, CompanyID, SiteAddress1, SiteAddress2 , SiteAddress3
===== ========= ===== ========== ========== ==========
767241 , 1202 ,Devonshire Square , 3- 11 Devonshire Square, London
79007 ,1000 , A house, Somewhere, London
767242 , 904 ,Devonshire Square , 3- 11 Devonshire Square, London
The question I have is there any way I can generate a unique value in the SiteID column based on the existing SiteID and CompanyID ?