Sql server 在SQL Server 2008中选择“查看并合并”和“死锁”
涉及公共基表的两条SQL语句使用UNION组合 此查询是由业务对象和工作了一段时间的报告生成的 最近,当针对生产数据集市运行报告时,我们开始看到以下错误 Msg 1205,第13级,第2状态,第1行Sql server 在SQL Server 2008中选择“查看并合并”和“死锁”,sql-server,deadlock,Sql Server,Deadlock,涉及公共基表的两条SQL语句使用UNION组合 此查询是由业务对象和工作了一段时间的报告生成的 最近,当针对生产数据集市运行报告时,我们开始看到以下错误 Msg 1205,第13级,第2状态,第1行 事务(进程ID 121)在与另一个进程的线程通信缓冲区资源上被死锁,并被选为死锁受害者。重新运行事务 我复制了这个查询,并在开发中运行了它,它在PROD中的行数与PROD中的行数大致相同,但在生产中运行时,它给了我与上面相同的错误 ALTER VIEW [dbo].[TESTDetails_CASS
事务(进程ID 121)在与另一个进程的线程通信缓冲区资源上被死锁,并被选为死锁受害者。重新运行事务 我复制了这个查询,并在开发中运行了它,它在PROD中的行数与PROD中的行数大致相同,但在生产中运行时,它给了我与上面相同的错误
ALTER VIEW [dbo].[TESTDetails_CASSETS]
AS
SELECT
allocation.SeatNumber,LDMCateg.LookupDescription as SeatCategory,
Country.CountryName AS Country,
CityMaster.Cityname AS City,
FacilityMaster.FacilityDescription AS Facility,
BuildingMaster.BuildingDescription AS Building,
FloorMaster.FloorDescription AS Floor,
WingMaster.WingDescription AS Wing,
BayMaster.BayDescription AS Bay,
allocation.AssociateID, allocation.AssociateName,
allocation.PoolID AS ProjectID,
allocation.PoolName AS ProjectName,
allocation.SeatAllocationStartDate,
allocation.SeatAllocationEndDate,
allocation.ShiftStartTime,
allocation.ShiftEndTime,
AllocAccount.PoolID as AccountID,
AllocAccount.PoolName as AccountName,
AllocPRactice.PoolID AS PracticeID,
data.SeatRequestTypeDesc AS SeatAllocationType,
dbo.FloorMaster.HCMLocationCode,
LDMNetwork.LookupDescription as Network,
LDMSEZ.LookupDescription as FacilityType,
LDMSECLUDED.LookupDescription as IsSeatSecluded
FROM
dbo.SeatAllocation(NOLOCK) AS allocation
INNER JOIN
dbo.SeatAllocation(NOLOCK) AllocPRactice on allocation.SeatNumber = AllocPRactice.SeatNumber
INNER JOIN
dbo.SeatAllocation(NOLOCK) AllocAccount on allocation.SeatNumber = AllocAccount.SeatNumber
INNER JOIN
dbo.SeatRequestType(NOLOCK) AS data ON allocation.SeatAllocationTypeID = data.SeatRequestTypeID
INNER JOIN
dbo.SeatMaster(NOLOCK) AS SeatMr ON SeatMr.SeatNumber = allocation.SeatNumber
INNER JOIN
dbo.Country(NOLOCK) ON dbo.Country.CountryID = SeatMr.CountryID
INNER JOIN
dbo.CityMaster(NOLOCK) ON dbo.CityMaster.CityID = SeatMr.CityID
LEFT OUTER JOIN
dbo.FacilityMaster(NOLOCK) ON dbo.FacilityMaster.FacilityID = SeatMr.FacilityID
LEFT OUTER JOIN
dbo.BuildingMaster(NOLOCK) ON dbo.BuildingMaster.BuildingID = SeatMr.BuildingID
LEFT OUTER JOIN
dbo.FloorMaster(NOLOCK) ON dbo.FloorMaster.FloorID = SeatMr.FloorID
LEFT OUTER JOIN
dbo.WingMaster(NOLOCK) ON SeatMr.WingId = dbo.WingMaster.WingID
LEFT OUTER JOIN
dbo.BayMaster(NOLOCK) ON SeatMr.BayID = dbo.BayMaster.BayID
INNER JOIN
dbo.LookupDataMaster(NOLOCK) LDMCateg on SeatMr.SeatCategoryID = LDMCateg.LookupTypeID
INNER JOIN
dbo.LookupDataMaster(NOLOCK) LDMNetwork on SeatMr.NetworkType = LDMNetwork.LookupTypeID
INNER JOIN
dbo.LookupDataMaster(NOLOCK) LDMSEZ on FacilityMaster.FacilityType = LDMSEZ.LookupTypeID
INNER JOIN
dbo.LookupDataMaster(NOLOCK) LDMSECLUDED on SeatMr.IsSecluded = LDMSECLUDED.LookupTypeID
WHERE
(allocation.AssociateID IS NOT NULL)
AND (allocation.SeatNumber <> '')
--AND (dbo.CityMaster.CityID IN (10, 4, 1))
AND AllocPRactice.PoolType = 96
--AND AllocAccount.PoolType = 97
AND AllocAccount.PoolType = 99
AND allocation.SeatAllocationTypeID = 1
AND LDMCateg.LookupCategoryMasterID = 13
AND LDMNetwork.LookupCategoryMasterID = 8
AND LDMSEZ.LookupCategoryMasterID = 12
AND LDMSECLUDED.LookupCategoryMasterID = 6
UNION
SELECT
allocation.SeatNumber,
LDMCateg.LookupDescription as SeatCategory,
Country.CountryName AS Country,
CityMaster.Cityname AS City,
FacilityMaster.FacilityDescription AS Facility,
BuildingMaster.BuildingDescription AS Building,
FloorMaster.FloorDescription AS Floor,
WingMaster.WingDescription AS Wing,
BayMaster.BayDescription AS Bay,
allocation.AssociateID,
allocation.AssociateName,
allocation.PoolID AS ProjectID,
allocation.PoolName AS ProjectName,
allocation.SeatAllocationStartDate,
allocation.SeatAllocationEndDate,
allocation.ShiftStartTime,
allocation.ShiftEndTime,
SeatMr.AccountID as AccountID,
SeatMr.AccountName as AccountName,
SeatMr.BusinessUnitID AS PracticeID,
data.SeatRequestTypeDesc AS SeatAllocationType,
dbo.FloorMaster.HCMLocationCode,
LDMNetwork.LookupDescription as Network,
LDMSEZ.LookupDescription as FacilityType,
LDMSECLUDED.LookupDescription as IsSeatSecluded
FROM
dbo.SeatAllocation(NOLOCK) AS allocation INNER JOIN
dbo.SeatRequestType(NOLOCK) AS data ON allocation.SeatAllocationTypeID = data.SeatRequestTypeID INNER JOIN
dbo.SeatMaster(NOLOCK) AS SeatMr ON SeatMr.SeatNumber = allocation.SeatNumber INNER JOIN
dbo.Country(NOLOCK) ON dbo.Country.CountryID = SeatMr.CountryID INNER JOIN
dbo.CityMaster(NOLOCK) ON dbo.CityMaster.CityID = SeatMr.CityID LEFT OUTER JOIN
dbo.FacilityMaster(NOLOCK) ON dbo.FacilityMaster.FacilityID = SeatMr.FacilityID LEFT OUTER JOIN
dbo.BuildingMaster(NOLOCK) ON dbo.BuildingMaster.BuildingID = SeatMr.BuildingID LEFT OUTER JOIN
dbo.FloorMaster(NOLOCK) ON dbo.FloorMaster.FloorID = SeatMr.FloorID LEFT OUTER JOIN
dbo.WingMaster(NOLOCK) ON SeatMr.WingId = dbo.WingMaster.WingID LEFT OUTER JOIN
dbo.BayMaster(NOLOCK) ON SeatMr.BayID = dbo.BayMaster.BayID INNER JOIN
dbo.LookupDataMaster(NOLOCK) LDMCateg on SeatMr.SeatCategoryID = LDMCateg.LookupTypeID INNER JOIN
dbo.LookupDataMaster(NOLOCK) LDMNetwork on SeatMr.NetworkType = LDMNetwork.LookupTypeID INNER JOIN
dbo.LookupDataMaster(NOLOCK) LDMSEZ on FacilityMaster.FacilityType = LDMSEZ.LookupTypeID INNER JOIN
dbo.LookupDataMaster(NOLOCK) LDMSECLUDED on SeatMr.IsSecluded = LDMSECLUDED.LookupTypeID
WHERE
(allocation.AssociateID IS NOT NULL)
AND (allocation.SeatNumber <> '')
--AND (dbo.CityMaster.CityID IN (10, 4, 1))
AND allocation.SeatAllocationTypeID = 2
AND LDMCateg.LookupCategoryMasterID = 13
AND LDMNetwork.LookupCategoryMasterID = 8
AND LDMSEZ.LookupCategoryMasterID = 12
AND LDMSECLUDED.LookupCategoryMasterID = 6
UNION
SELECT
SeatMr.SeatNumber,
LDMCateg.LookupDescription as SeatCategory,
Country.CountryName AS Country,
CityMaster.Cityname AS City,
FacilityMaster.FacilityDescription AS Facility,
BuildingMaster.BuildingDescription AS Building,
FloorMaster.FloorDescription AS Floor,
WingMaster.WingDescription AS Wing,
BayMaster.BayDescription AS Bay,
NULL AS AssociateID,
NULL AS AssociateName,
NULL AS ProjectID,
NULL AS ProjectName,
NULL AS SeatAllocationStartDate,
NULL AS SeatAllocationEndDate,
NULL AS ShiftStartTime,
NULL AS ShiftEndTime,
NULL AS AccountID,
NULL AS AccountName,
NULL AS PracticeID,
NULL AS SeatAllocationType,
FloorMaster.HCMLocationCode,
LDMNetwork.LookupDescription as Network,
LDMSEZ.LookupDescription as FacilityType,
LDMSECLUDED.LookupDescription as IsSeatSecluded
FROM
dbo.SeatMaster(NOLOCK) AS SeatMr INNER JOIN
dbo.Country(NOLOCK) ON dbo.Country.CountryID = SeatMr.CountryID INNER JOIN
dbo.CityMaster(NOLOCK) ON dbo.CityMaster.CityID = SeatMr.CityID LEFT OUTER JOIN
dbo.FacilityMaster(NOLOCK) ON dbo.FacilityMaster.FacilityID = SeatMr.FacilityID LEFT OUTER JOIN
dbo.BuildingMaster(NOLOCK) ON dbo.BuildingMaster.BuildingID = SeatMr.BuildingID LEFT OUTER JOIN
dbo.FloorMaster(NOLOCK) ON dbo.FloorMaster.FloorID = SeatMr.FloorID LEFT OUTER JOIN
dbo.WingMaster(NOLOCK) ON SeatMr.WingId = dbo.WingMaster.WingID LEFT OUTER JOIN
dbo.BayMaster(NOLOCK) ON SeatMr.BayID = dbo.BayMaster.BayID INNER JOIN
dbo.LookupDataMaster(NOLOCK) LDMCateg on SeatMr.SeatCategoryID = LDMCateg.LookupTypeID INNER JOIN
dbo.LookupDataMaster(NOLOCK) LDMNetwork on SeatMr.NetworkType = LDMNetwork.LookupTypeID INNER JOIN
dbo.LookupDataMaster(NOLOCK) LDMSEZ on FacilityMaster.FacilityType = LDMSEZ.LookupTypeID INNER JOIN
dbo.LookupDataMaster(NOLOCK) LDMSECLUDED on SeatMr.IsSecluded = LDMSECLUDED.LookupTypeID
WHERE
(SeatMr.SeatNumber <> '')
--AND (dbo.CityMaster.CityID IN (10, 4, 1))
AND SeatMr.BusinessUnitID is NULL and SeatMr.AccountID is NULL
AND SeatMr.SeatNumber NOT IN (SELECT SeatNumber FROM SeatAllocation WHERE SeatAllocationTypeID = 2)
AND LDMCateg.LookupCategoryMasterID = 13
AND LDMNetwork.LookupCategoryMasterID = 8
AND LDMSEZ.LookupCategoryMasterID = 12
AND LDMSECLUDED.LookupCategoryMasterID = 6
UNION
SELECT
SeatMr.SeatNumber,
LDMCateg.LookupDescription as SeatCategory,
Country.CountryName AS Country,
CityMaster.Cityname AS City,
FacilityMaster.FacilityDescription AS Facility,
BuildingMaster.BuildingDescription AS Building,
FloorMaster.FloorDescription AS Floor,
WingMaster.WingDescription AS Wing,
BayMaster.BayDescription AS Bay,
NULL AS AssociateID,
NULL AS AssociateName,
NULL AS ProjectID,
NULL AS ProjectName,
NULL AS SeatAllocationStartDate,
NULL AS SeatAllocationEndDate,
NULL AS ShiftStartTime,
NULL AS ShiftEndTime,
NULL AS AccountID,
NULL AS AccountName,
Allocation.PoolID AS PracticeID,
NULL AS SeatAllocationType,
FloorMaster.HCMLocationCode,
LDMNetwork.LookupDescription as Network,
LDMSEZ.LookupDescription as FacilityType,
LDMSECLUDED.LookupDescription as IsSeatSecluded
FROM
dbo.SeatMaster(NOLOCK) AS SeatMr INNER JOIN
dbo.SeatAllocation(NOLOCK) as Allocation on SeatMr.SeatNumber = Allocation.SeatNumber INNER JOIN
dbo.Country(NOLOCK) ON dbo.Country.CountryID = SeatMr.CountryID INNER JOIN
dbo.CityMaster(NOLOCK) ON dbo.CityMaster.CityID = SeatMr.CityID LEFT OUTER JOIN
dbo.FacilityMaster(NOLOCK) ON dbo.FacilityMaster.FacilityID = SeatMr.FacilityID LEFT OUTER JOIN
dbo.BuildingMaster(NOLOCK) ON dbo.BuildingMaster.BuildingID = SeatMr.BuildingID LEFT OUTER JOIN
dbo.FloorMaster(NOLOCK) ON dbo.FloorMaster.FloorID = SeatMr.FloorID LEFT OUTER JOIN
dbo.WingMaster(NOLOCK) ON SeatMr.WingId = dbo.WingMaster.WingID LEFT OUTER JOIN
dbo.BayMaster(NOLOCK) ON SeatMr.BayID = dbo.BayMaster.BayID INNER JOIN
dbo.LookupDataMaster(NOLOCK) LDMCateg on SeatMr.SeatCategoryID = LDMCateg.LookupTypeID INNER JOIN
dbo.LookupDataMaster(NOLOCK) LDMNetwork on SeatMr.NetworkType = LDMNetwork.LookupTypeID INNER JOIN
dbo.LookupDataMaster(NOLOCK) LDMSEZ on FacilityMaster.FacilityType = LDMSEZ.LookupTypeID INNER JOIN
dbo.LookupDataMaster(NOLOCK) LDMSECLUDED on SeatMr.IsSecluded = LDMSECLUDED.LookupTypeID
WHERE
(SeatMr.SeatNumber <> '')
--AND (dbo.CityMaster.CityID IN (10, 4, 1))
AND SeatMr.BusinessUnitID is Not NULL
and SeatMr.AccountID is NULL
and Allocation.PoolType = 96
AND LDMCateg.LookupCategoryMasterID = 13
AND LDMNetwork.LookupCategoryMasterID = 8
AND LDMSEZ.LookupCategoryMasterID = 12
AND LDMSECLUDED.LookupCategoryMasterID = 6
UNION
SELECT
SeatMr.SeatNumber,
LDMCateg.LookupDescription as SeatCategory,
dbo.Country.CountryName AS Country,
dbo.CityMaster.Cityname AS City,
dbo.FacilityMaster.FacilityDescription AS Facility,
dbo.BuildingMaster.BuildingDescription AS Building,
dbo.FloorMaster.FloorDescription AS Floor,
dbo.WingMaster.WingDescription AS Wing,
dbo.BayMaster.BayDescription AS Bay,
NULL AS AssociateID,
NULL AS AssociateName,
NULL AS ProjectID,
NULL AS ProjectName,
NULL AS SeatAllocationStartDate,
NULL AS SeatAllocationEndDate,
NULL AS ShiftStartTime,
NULL AS ShiftEndTime,
Allocation.PoolID AS AccountID,
Allocation.PoolName AS AccountName,
AllocPractice.PoolID AS PracticeID,
NULL AS SeatAllocationType,
FloorMaster.HCMLocationCode,
LDMNetwork.LookupDescription as Network,
LDMSEZ.LookupDescription as FacilityType,
LDMSECLUDED.LookupDescription as IsSeatSecluded
FROM
dbo.SeatMaster(NOLOCK) AS SeatMr INNER JOIN
dbo.SeatAllocation(NOLOCK) as Allocation on SeatMr.SeatNumber = Allocation.SeatNumber INNER JOIN
dbo.SeatAllocation AllocPractice on allocation.SeatNumber = AllocPRactice.SeatNumber INNER JOIN
dbo.Country(NOLOCK) ON dbo.Country.CountryID = SeatMr.CountryID INNER JOIN
dbo.CityMaster(NOLOCK) ON dbo.CityMaster.CityID = SeatMr.CityID LEFT OUTER JOIN
dbo.FacilityMaster(NOLOCK) ON dbo.FacilityMaster.FacilityID = SeatMr.FacilityID LEFT OUTER JOIN
dbo.BuildingMaster(NOLOCK) ON dbo.BuildingMaster.BuildingID = SeatMr.BuildingID LEFT OUTER JOIN
dbo.FloorMaster(NOLOCK) ON dbo.FloorMaster.FloorID = SeatMr.FloorID LEFT OUTER JOIN
dbo.WingMaster(NOLOCK) ON SeatMr.WingId = dbo.WingMaster.WingID LEFT OUTER JOIN
dbo.BayMaster(NOLOCK) ON SeatMr.BayID = dbo.BayMaster.BayID INNER JOIN
dbo.LookupDataMaster(NOLOCK) LDMCateg on SeatMr.SeatCategoryID = LDMCateg.LookupTypeID INNER JOIN
dbo.LookupDataMaster(NOLOCK) LDMNetwork on SeatMr.NetworkType = LDMNetwork.LookupTypeID INNER JOIN
dbo.LookupDataMaster(NOLOCK) LDMSEZ on FacilityMaster.FacilityType = LDMSEZ.LookupTypeID INNER JOIN
dbo.LookupDataMaster(NOLOCK) LDMSECLUDED on SeatMr.IsSecluded = LDMSECLUDED.LookupTypeID
WHERE
(SeatMr.SeatNumber <> '')
--AND (dbo.CityMaster.CityID IN (10, 4, 1))
AND SeatMr.BusinessUnitID IS NOT NULL
and SeatMr.AccountID IS NOT NULL
--and Allocation.PoolType = 97
and Allocation.PoolType = 99
AND AllocPractice.PoolType = 96
AND SeatMr.SeatNumber NOT IN
(
SELECT
alloc.SeatNumber
FROM
dbo.SeatAllocation AS alloc INNER JOIN
dbo.SeatRequestType AS data ON alloc.SeatAllocationTypeID = data.SeatRequestTypeID INNER JOIN
dbo.SeatMaster AS SeatMr ON SeatMr.SeatNumber = alloc.SeatNumber
WHERE
alloc.PoolType = 98
)
AND LDMCateg.LookupCategoryMasterID = 13
AND LDMNetwork.LookupCategoryMasterID = 8
AND LDMSEZ.LookupCategoryMasterID = 12
AND LDMSECLUDED.LookupCategoryMasterID = 6
UNION
SELECT
ProjectAllocation.SeatNumber,
LDMCateg.LookupDescription as SeatCategory,
Country.CountryName AS Country,
CityMaster.Cityname AS City,
FacilityMaster.FacilityDescription AS Facility,
BuildingMaster.BuildingDescription AS Building,
FloorMaster.FloorDescription AS Floor,
WingMaster.WingDescription AS Wing,
BayMaster.BayDescription AS Bay,
ProjectAllocation.AssociateID,
ProjectAllocation.AssociateName,
ProjectAllocation.PoolID AS ProjectID,
ProjectAllocation.PoolName AS ProjectName,
ProjectAllocation.SeatAllocationStartDate,
ProjectAllocation.SeatAllocationEndDate,
ProjectAllocation.ShiftStartTime,
ProjectAllocation.ShiftEndTime,
AccountAllocation.PoolID AccountID,
AccountAllocation.PoolName AccountName,
PracticeAllocation.PoolID PracticeID,
data.SeatRequestTypeDesc AS SeatAllocationType,
FloorMaster.HCMLocationCode,
LDMNetwork.LookupDescription as Network,
LDMSEZ.LookupDescription as FacilityType,
LDMSECLUDED.LookupDescription as IsSeatSecluded
FROM
dbo.SeatAllocation(NOLOCK) AS ProjectAllocation INNER JOIN
dbo.SeatMaster(NOLOCK) AS SeatMr ON SeatMr.SeatNumber = ProjectAllocation.SeatNumber INNER JOIN
dbo.SeatAllocation(NOLOCK) AS AccountAllocation ON AccountAllocation.SeatNumber = SeatMr.SeatNumber INNER JOIN
dbo.SeatAllocation(NOLOCK) AS PracticeAllocation ON PracticeAllocation.SeatNumber = SeatMr.SeatNumber INNER JOIN
dbo.SeatRequestType(NOLOCK) AS data ON ProjectAllocation.SeatAllocationTypeID = data.SeatRequestTypeID INNER JOIN
dbo.Country(NOLOCK) ON dbo.Country.CountryID = SeatMr.CountryID INNER JOIN
dbo.CityMaster(NOLOCK) ON dbo.CityMaster.CityID = SeatMr.CityID LEFT OUTER JOIN
dbo.FacilityMaster(NOLOCK) ON dbo.FacilityMaster.FacilityID = SeatMr.FacilityID LEFT OUTER JOIN
dbo.BuildingMaster(NOLOCK) ON dbo.BuildingMaster.BuildingID = SeatMr.BuildingID LEFT OUTER JOIN
dbo.FloorMaster(NOLOCK) ON dbo.FloorMaster.FloorID = SeatMr.FloorID LEFT OUTER JOIN
dbo.WingMaster(NOLOCK) ON SeatMr.WingId = dbo.WingMaster.WingID LEFT OUTER JOIN
dbo.BayMaster(NOLOCK) ON SeatMr.BayID = dbo.BayMaster.BayID INNER JOIN
dbo.LookupDataMaster(NOLOCK) LDMCateg on SeatMr.SeatCategoryID = LDMCateg.LookupTypeID INNER JOIN
dbo.LookupDataMaster(NOLOCK) LDMNetwork on SeatMr.NetworkType = LDMNetwork.LookupTypeID INNER JOIN
dbo.LookupDataMaster(NOLOCK) LDMSEZ on FacilityMaster.FacilityType = LDMSEZ.LookupTypeID INNER JOIN
dbo.LookupDataMaster(NOLOCK) LDMSECLUDED on SeatMr.IsSecluded = LDMSECLUDED.LookupTypeID
WHERE
(ProjectAllocation.AssociateID is NULL)
AND (ProjectAllocation.SeatNumber <> '')
AND SeatMr.BusinessUnitID IS NOT NULL
AND SeatMr.AccountID IS NOT NULL
AND ProjectAllocation.PoolType = 98
--AND AccountAllocation.PoolType = 97
AND AccountAllocation.PoolType = 99
AND PracticeAllocation.PoolType = 96
AND LDMCateg.LookupCategoryMasterID = 13
AND LDMNetwork.LookupCategoryMasterID = 8
AND LDMSEZ.LookupCategoryMasterID = 12
AND LDMSECLUDED.LookupCategoryMasterID = 6
GO
alterview[dbo].[TESTDetails\u CASSETS]
作为
挑选
allocation.SeatNumber,LDMCateg.LookupDescription作为SeatCategory,
Country.CountryName作为国家,
CityMaster。Cityname作为城市,
FacilityMaster.FacilityDescription作为设施,
BuildingMaster.BuildingDescription作为建筑,
FloorMaster.FloorDescription作为地板,
WingMaster.WingDescription作为Wing,
BayMaster.Bay描述为Bay,
allocation.AssociateID,allocation.AssociateName,
allocation.PoolID作为ProjectID,
allocation.PoolName作为项目名称,
allocation.sealtallocation开始日期,
allocation.SeatAllocationEndDate,
allocation.shiftsStart时间,
分配时间,
AllocAccount.PoolID作为AccountID,
AllocAccount.PoolName作为AccountName,
AllocPRactice.PoolID作为PracticeID,
data.SeatRequestTypeDesc作为SeatLocationType,
dbo.FloorMaster.HCMLocationCode,
LDMNetwork.LookupDescription作为网络,
LDMSEZ.LookupDescription作为设备类型,
LDMSECLUDED.LookupDescription作为ISSEATSEACLUDED
从…起
dbo.SeatAllocation(NOLOCK)作为分配
内连接
dbo.seataLocation(NOLOCK)AllocPRactice on allocation.SeatNumber=AllocPRactice.SeatNumber
内连接
dbo.sealtallocation(NOLOCK)AllocAccount on allocation.SeatNumber=AllocAccount.SeatNumber
内连接
dbo.SeatRequestType(NOLOCK)作为分配上的数据。seatLocationTypeId=data.SeatRequestTypeID
内连接
dbo.SeatMaster(NOLOCK)作为SeatMr ON SeatMr.SeatNumber=allocation.SeatNumber
内连接
dbo.Country.CountryID=SeatMr.CountryID上的dbo.Country(NOLOCK)
内连接
dbo.CityMaster.CityID=SeatMr.CityID上的dbo.CityMaster(NOLOCK)
左外连接
dbo.FacilityMaster.FacilityID=SeatMr.FacilityID上的dbo.FacilityMaster(NOLOCK)
左外连接
dbo.BuildingMaster.BuildingID=SeatMr.BuildingID上的dbo.BuildingMaster(NOLOCK)
左外连接
dbo.FloorMaster.floorrid=SeatMr.floorrid上的dbo.FloorMaster(NOLOCK)
左外连接
座位上的dbo.WingMaster(NOLOCK)tmr.WingId=dbo.WingMaster.WingId
左外连接
SeatMr.BayID=dbo.BayMaster.BayID上的dbo.BayMaster(NOLOCK)
内连接
SeatMr.SeatCategoryID=LDMCateg.LookupTypeID上的dbo.lookUpdateMaster(NOLOCK)LDMCateg
内连接
SeatMr.NetworkType=LDMNetwork.LookupTypeID上的dbo.lookUpdateMaster(NOLOCK)LDMNetwork
内连接
FacilityMaster.FacilityType=LDMSEZ.LookupTypeID上的dbo.LookUpdateMaster(NOLOCK)LDMSEZ
内连接
dbo.lookUpdateMaster(NOLOCK)LDMSECLUDED on SeatMr.IsSecluded=LDMSECLUDED.LookupTypeID
哪里
(allocation.AssociateID不为空)
和(allocation.SeatNumber“”)
--和(dbo.CityMaster.CityID IN(10,4,1))
和AllocPRactice.PoolType=96
--和AllocAccount.PoolType=97
和AllocAccount.PoolType=99
和分配。seataLocationTypeId=1
和LDMCateg.LookupCategoryMasterID=13
和LDMNetwork.LookupCategoryMasterID=8
和LDMSEZ.LookupCategoryMasterID=12
和LDMSECLUDED.LookupCategoryMasterID=6
联合
挑选
分配。座位号,
LDMCateg.LookupDescription作为SeatCategory,
Country.CountryName作为国家,
CityMaster。Cityname作为城市,
FacilityMaster.FacilityDescription作为设施,
BuildingMaster.BuildingDescription作为建筑,
FloorMaster.FloorDescription作为地板,
WingMaster.WingDescription作为Wing,
BayMaster.Bay描述为Bay,
allocation.AssociateID,
allocation.AssociateName,
allocation.PoolID作为ProjectID,
allocation.PoolName作为项目名称,
allocation.sealtallocation开始日期,
allocation.SeatAllocationEndDate,
allocation.shiftsStart时间,
分配时间,
SeatMr.AccountID作为AccountID,
SeatMr.AccountName作为AccountName,
SeatMr.BusinessUnitID作为实践ID,
data.SeatRequestTypeDesc作为SeatLocationType,
dbo.FloorMaster.HCMLocationCode,
LDMNetwork.LookupDescription作为网络,
LDMSEZ.LookupDescription作为设备类型,
LDMSECLUDED.LookupDescription作为ISSEATSEACLUDED
从…起
dbo.SeatAllocation(NOLOCK)作为分配内部联接
dbo.SeatRequestType(NOLOCK)作为分配上的数据。seatLocationTypeId=data.SeatRequestTypeID内部联接
dbo.SeatMaster(NOLOCK)作为SeatMr ON SeatMr.SeatNumber=allocation.SeatNumber内部联接
dbo.Country.CountryID=SeatMr.CountryID内部联接上的dbo.Country(NOLOCK)
dbo.CityMaster.CityID=SeatMr.CityID左外连接上的dbo.CityMaster(NOLOCK)
dbo.FacilityMaster.FacilityID=SeatMr.FacilityID左外联接上的dbo.FacilityMaster(NOLOCK)
dbo.BuildingMaster.BuildingID=SeatMr.BuildingID左外连接上的dbo.BuildingMaster(NOLOCK)
dbo.FloorMaster.floorrid=SeatMr.floorrid左外连接上的dbo.FloorMaster(NOLOCK)
副机长(北)