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:03:46
|
| Hi,I can not get this sql to work with the AdventureWorks database. I think it is to do with the new security schema. thanksSELECT 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 JOIN Person.Address AS BillAddress INNER JOIN person.StateProvince AS BillStateProvince ON BillAddress.StateProvinceID = BillStateProvince.StateProvinceID INNER JOIN person.CountryRegion AS BillCountryRegion ON BillAddress.CountryRegionCode = BillCountryRegion.CountryRegionCode ON sales.SalesOrderHeader.BillToAddressID = BillAddress.AddressID LEFT OUTER JOIN Person.Address AS ShipAddress INNER JOIN person.StateProvince AS ShipStateProvince ON ShipAddress.StateProvinceID = ShipStateProvince.StateProvinceID INNER JOIN person.CountryRegion AS ShipCountryRegion ON ShipAddress.CountryRegionCode = ShipCountryRegion.CountryRegionCode ON sales.SalesOrderHeader.ShipToAddressID = ShipAddress.AddressID LEFT OUTER JOIN humanResources.Employee ON SalesOrderHeader.SalesPersonID = humanResources.Employee.EmployeeID LEFT OUTER JOIN purchasing.ShipMethod ON SalesOrderHeader.ShipMethodID = ShipMethod.ShipMethodID LEFT OUTER JOIN sales.Store ON SalesOrderHeader.CustomerID = sales.Store.CustomerID |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2005-09-13 : 16:05:43
|
| Why would you want this query to work?Is this for SQL Server Reporting Services 2000?What new security schema are you referring to?What errors are you getting?Tara |
 |
|
|
fmardani
Constraint Violating Yak Guru
433 Posts |
Posted - 2005-09-13 : 16:20:16
|
| if you run it in 2005 you will see a few errors regarding multipart identifier, etc... |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2005-09-13 : 16:22:48
|
| I don't have the 2005 version of the AdventureWorks database. I only have the 2000 version. You'll want to post this question in the 2005 forum.Tara |
 |
|
|
|
|
|
|
|