Files
DP44/DataPRO_sql/dbo.v_MMEFineLocations2.View.sql
2026-04-17 14:55:32 -04:00

46 lines
3.3 KiB
Transact-SQL
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
IF EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[v_MMEFineLocations2]'))
DROP VIEW [dbo].[v_MMEFineLocations2]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[v_MMEFineLocations2]'))
EXEC dbo.sp_executesql @statement = N'
CREATE VIEW [dbo].[v_MMEFineLocations2]
AS
SELECT
[s_GUID]
, isnull( [FINE_LOC_2] , space(0)) as [FINE_LOC_2]
, isnull( [TEXT_L1] , space(0)) as [TEXT_L1]
, isnull( [TEXT_L2] , space(0)) as [TEXT_L2]
, isnull( [VERSION] , space(0)) as [VERSION]
, isnull( [DATE] , space(0)) as [DATE]
, isnull( [REMARKS] , space(0)) as [REMARKS]
, isnull( [EXPIRED] , space(0)) as [EXPIRED]
, isnull( [SORTKEY] , space(0)) as [SORTKEY]
, isnull( [LAST_CHANGE] , space(0)) as [LAST_CHANGE]
, isnull( [LAST_CHANGE_TEXT] , space(0)) as [LAST_CHANGE_TEXT]
, isnull( [HISTORY] , space(0)) as [HISTORY]
, 0 AS ''ISOFlag''
FROM dbo.MMEFineLocations2
UNION ALL
SELECT [s_GUID]
, isnull( [FINE_LOC_2] , space(0)) as [FINE_LOC_2]
, isnull( [TEXT_L1] , space(0)) as [TEXT_L1]
, isnull( [TEXT_L2] , space(0)) as [TEXT_L2]
, isnull( [VERSION] , space(0)) as [VERSION]
, isnull( [DATE] , space(0)) as [DATE]
, isnull( [REMARKS] , space(0)) as [REMARKS]
, isnull( [EXPIRED] , space(0)) as [EXPIRED]
, isnull( [SORTKEY] , space(0)) as [SORTKEY]
, isnull( [LAST_CHANGE] , space(0)) as [LAST_CHANGE]
, isnull( [LAST_CHANGE_TEXT] , space(0)) as [LAST_CHANGE_TEXT]
, isnull( [HISTORY] , space(0)) as [HISTORY]
, 1 AS ''ISOFlag''
FROM [ISO].dbo.MMEFineLocations2
'
GO