CREATE VIEW VWEXPORT_CONTRACT AS 
SELECT T.[GUID] AS CONTROL_GUID
      ,T.[FORM_ID] AS CONTROL_FORM_ID
      ,T.[CONTROL_TYPE_ID] AS CONTROL_TYPE_ID
      ,T.[NAME] AS CONTROL_NAME
      ,T.[FORMAT_TYPE] AS CONTROL_FORMAT_TYPE
      ,T.[SHOW_COLUMN] AS CONTROL_SHOW_COLUMN
      ,T.[COL_NAME] AS CONTROL_COL_NAME
      ,T.[REQUIRED] AS CONTROL_REQUIRED
      ,T.[PARENT_CONTROL_ID] AS CONTROL_PARENT_CONTROL_ID
      ,T.[MASTER_DATA_ID] AS CONTROL_MASTER_DATA_ID
      ,T.[MULTILINE] AS CONTROL_MULTILINE
      ,T.[STATIC_LIST] AS CONTROL_STATIC_LIST
      ,T.[DEFAULT_VALUE] AS CONTROL_DEFAULT_VALUE
      ,T.[SQL_COMMAND_1] AS CONTROL_SQL_COMMAND_1
      ,T.[CONNECTION_ID_1] AS CONTROL_CONNECTION_ID_1
      ,T.[READ_ONLY] AS CONTROL_READ_ONLY
      ,T.[VALIDATION] AS CONTROL_VALIDATION
      ,T.[ADDED_WHO] AS CONTROL_ADDED_WHO
      ,T.[VISIBLE] AS CONTROL_VISIBLE
      ,T.[TREE_VIEW] AS CONTROL_TREE_VIEW
      ,T.[SELECT_ONLY] AS CONTROL_SELECT_ONLY
	  ,T1.[GUID] AS CS_GUID
      ,T1.[CONTROL_ID] AS CS_CONTROL_ID
      ,T1.[SCREEN_ID] AS CS_SCREEN_ID
      ,T1.[CONTROL_TEXT] AS CS_CONTROL_TEXT
      ,T1.[X_LOC] AS CS_X_LOC
      ,T1.[Y_LOC] AS CS_Y_LOC
      ,T1.[HEIGHT] AS CS_HEIGHT
      ,T1.[WIDTH] AS CS_WIDTH
      ,T1.[FONT_FAMILY] AS CS_FONT_FAMILY
      ,T1.[FONT_COLOR] AS CS_FONT_COLOR
      ,T1.[FONT_SIZE] AS CS_FONT_SIZE
      ,T1.[FONT_STYLE] AS CS_FONT_STYLE
      ,T1.[BACK_COLOR] AS CS_BACK_COLOR
      ,T1.[TAB_INDEX] AS CS_TAB_INDEX
      ,T1.[TAB_STOP] AS CS_TAB_STOP
  FROM [dbo].[TBPMO_CONTROL] T, TBPMO_CONTROL_SCREEN T1 WHERE T.GUID = T1.CONTROL_ID AND T1.SCREEN_ID = 1 AND FORM_ID = 1
GO


