Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
fmardani
Constraint Violating Yak Guru
433 Posts |
Posted - 2005-09-13 : 16:21:33
|
| Hi,I can not get this sql to work with the AdventureWorks database. I think it is to do with the new security schema. thanksp.s. I incorrectly posted this into another session. sorrySELECT SalesOrderHeader.SalesOrderNumber, Store.Name AS Store, SalesOrderHeader.OrderDate, Employee.FirstName AS SalesFirstName, Employee.LastName AS SalesLastName, Employee.Title AS SalesTitle, SalesOrderHeader.PurchaseOrderNumber, ShipMethod.Name AS ShipMethod, BillAddress.AddressLine1 AS BillAddress1, BillAddress.AddressLine2 AS BillAddress2, BillAddress.City AS BillCity, BillAddress.PostalCode AS BillPostalCode, BillStateProvince.Name AS BillStateProvince, BillCountryRegion.Name AS BillCountryRegion, BillAddress.Phone AS BillPhone, ShipAddress.AddressLine1 AS ShipAddress1, ShipAddress.AddressLine2 AS ShipAddress2, ShipAddress.City AS ShipCity, ShipAddress.PostalCode AS ShipPostalCode, ShipStateProvince.Name AS ShipStateProvince, ShipCountryRegion.Name AS ShipCountryRegion, ShipAddress.Phone AS ShipPhoneFROM sales.SalesOrderHeader LEFT OUTER JOINPerson.Address AS BillAddress INNER JOINperson.StateProvince AS BillStateProvince ON BillAddress.StateProvinceID = BillStateProvince.StateProvinceID INNER JOINperson.CountryRegion AS BillCountryRegion ON BillAddress.CountryRegionCode = BillCountryRegion.CountryRegionCode ON sales.SalesOrderHeader.BillToAddressID = BillAddress.AddressID LEFT OUTER JOINPerson.Address AS ShipAddress INNER JOINperson.StateProvince AS ShipStateProvince ON ShipAddress.StateProvinceID = ShipStateProvince.StateProvinceID INNER JOINperson.CountryRegion AS ShipCountryRegion ON ShipAddress.CountryRegionCode = ShipCountryRegion.CountryRegionCode ON sales.SalesOrderHeader.ShipToAddressID = ShipAddress.AddressID LEFT OUTER JOINhumanResources.Employee ON SalesOrderHeader.SalesPersonID = humanResources.Employee.EmployeeID LEFT OUTER JOINpurchasing.ShipMethod ON SalesOrderHeader.ShipMethodID = ShipMethod.ShipMethodID LEFT OUTER JOINsales.Store ON SalesOrderHeader.CustomerID = sales.Store.CustomerID |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|
|
|