
/****** Object:  View [dbo].[ApiImpCustView]    Script Date: 13.09.2021 14:25:19 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


CREATE VIEW [dbo].[ApiImpCustView] as
select   s.DSta_KntGrupa Grupa, Code Kod, TAXID NIPE, c.Name Nazwa1, AdrrStreet Ulica, AdrrNumber NrDomu, AdrrAppNumber NrLokalu, AdrrZip KodPocztowy, AdrrCity Miasto, AdrrCountry KrajISO, Phone Telefon1, Phone2 Telefon2, Email Email,0 AkwizytorId, WWW, ErpId OptimaId, Id KntId, Notes, geolat, geolong 
from dbo.ApiCustomers c 
LEFT OUTER JOIN  CDN.DetalStanowiska s ON c.VendorId = s.DSta_DStaId 
where ISNULL(State,1) in (1,-1)
GO


