1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| CREATE VIEW V_LIVComputers
AS
SELECT 'ATFAC' AS Entity, Id, UserId, UserName, Siglum, [Device No], [Status], ScreenFilter, PC_AssetNum, PC_Model, PC_Type, PC_SN, [Owner], [PC DeliveryDate], LockNo, OS, CPU, Memory, HD, [E-port], Accessories,Remark,Vendor, NULL AS [Leasing (Y/N)], NULL AS LCD_AssetNum, NULL AS [Purchase/Leasing StartDate], NULL AS Location
FROM [InfoCenter].[dbo].[LIVComputers_ATFAC]
UNION ALL
SELECT 'ATJTC' AS Entity, Id, UserId, UserName, Siglum, [Device No], [Status], ScreenFilter, PC_AssetNum, PC_Model, PC_Type, PC_SN, [Owner], [PC DeliveryDate], LockNo, OS, CPU, Memory, HD, [E-port], Accessories,Remark,Vendor, NULL AS [Leasing (Y/N)], NULL AS LCD_AssetNum, NULL AS [Purchase/Leasing StartDate], NULL AS Location
FROM [InfoCenter].[dbo].[LIVComputers_ATJTC]
UNION ALL
SELECT 'TJSub' AS Entity, Id, UserId, UserName, Siglum, [Device No], [Status], ScreenFilter, PC_AssetNum, PC_Model, PC_Type, PC_SN, [Owner], [PC DeliveryDate], LockNo, OS, CPU, Memory, HD, [E-port], Accessories,Remark,Vendor, NULL AS [Leasing (Y/N)], NULL AS LCD_AssetNum, NULL AS [Purchase/Leasing StartDate], NULL AS Location
FROM [InfoCenter].[dbo].[LIVComputers_TJsub]
UNION ALL
SELECT 'AC' AS Entity, Id, UserId, UserName, Siglum, [Device No], [Status], ScreenFilter, PC_AssetNum, PC_Model, PC_Type, PC_SN, [Owner], [PC DeliveryDate], LockNo, OS, CPU, Memory, HD, [E-port], Accessories,Remark,Vendor, [Leasing (Y/N)], LCD_AssetNum,[Purchase/Leasing StartDate], NULL AS Location
FROM [InfoCenter].[dbo].[LIVComputersAC]
UNION ALL
SELECT 'ATDC' AS Entity, Id, UserId, UserName, Siglum, [Device No], [Status], ScreenFilter, PC_AssetNum, PC_Model, PC_Type, PC_SN, [Owner], [PC DeliveryDate], LockNo, OS, CPU, Memory, HD, [E-port], Accessories,Remark,Vendor, NULL AS [Leasing (Y/N)], NULL AS LCD_AssetNum, NULL AS [Purchase/Leasing StartDate], NULL AS Location
FROM [InfoCenter].[dbo].[LIVComputersATDC]
UNION ALL
SELECT 'ECAC' AS Entity, Id, UserId, UserName, Siglum, [Device No], [Status], ScreenFilter, PC_AssetNum, PC_Model, PC_Type, PC_SN, [Owner], [PC DeliveryDate], LockNo, OS, CPU, Memory, HD, [E-port], Accessories,Remark,Vendor, [Leasing (Y/N)], LCD_AssetNum,[Purchase/Leasing StartDate], NULL AS Location
FROM [InfoCenter].[dbo].[LIVComputersECAC]
UNION ALL
SELECT 'JV' AS Entity, Id, UserId, UserName, Siglum, [Device No], [Status], ScreenFilter, PC_AssetNum, PC_Model, PC_Type, PC_SN, [Owner], [PC DeliveryDate], LockNo, OS, CPU, Memory, HD, [E-port], Accessories,Remark,Vendor, [Leasing (Y/N)], LCD_AssetNum,[Purchase/Leasing StartDate], NULL AS Location
FROM [InfoCenter].[dbo].[LIVComputersJV]
UNION ALL
SELECT 'RCS' AS Entity, Id, UserId, UserName, Siglum, [Device No], [Status], ScreenFilter, PC_AssetNum, PC_Model, PC_Type, PC_SN, [Owner], [PC DeliveryDate], LockNo, OS, CPU, Memory, HD, [E-port], Accessories,Remark,Vendor, [Leasing (Y/N)], LCD_AssetNum,[Purchase/Leasing StartDate], NULL AS Location
FROM [InfoCenter].[dbo].[LIVComputersRCS]
UNION ALL
SELECT 'SC' AS Entity, Id, UserId, UserName, Siglum, [Device No], [Status], ScreenFilter, PC_AssetNum, PC_Model, PC_Type, PC_SN, [Owner], [PC DeliveryDate], LockNo, OS, CPU, Memory, HD, [E-port], Accessories,Remark,Vendor, [Leasing (Y/N)], LCD_AssetNum,[Purchase/Leasing StartDate], NULL AS Location
FROM [InfoCenter].[dbo].[LIVComputersSC] |
Partager