MERGE [dbo].[LOBSupportedPropertyType] A
USING [dbo].[#LOBSupportedPropertyType] B
ON
(
A.[ID] = B.[ID] AND A.[LOBId] = B.[LOBId] AND A.[TypeId] = B.[TypeId]
)
WHEN MATCHED THEN
UPDATE
SET A.[PropertyTypeId] = B.[PropertyTypeId]
,A.[PropertyTypeName] = B.[PropertyTypeName]
,A.[DefaultPropertyValue] = B.[DefaultPropertyValue]
,A.[PropertyTypeDisplayName] = B.[PropertyTypeDisplayName]
,A.[Guid] = B.[Guid]
WHEN NOT MATCHED THEN
INSERT
(
[ID]
,[LOBID]
,[TypeId]
,[PropertyTypeId]
,[PropertyTypeName]
,[DefaultPropertyValue]
,[PropertyTypeDisplayName]
,[Guid]
)
VALUES
(
B.[ID]
,B.[LOBID]
,B.[TypeId]
,B.[PropertyTypeId]
,B.[PropertyTypeName]
,B.[DefaultPropertyValue]
,B.[PropertyTypeDisplayName]
,B.[Guid]
);
USING [dbo].[#LOBSupportedPropertyType] B
ON
(
A.[ID] = B.[ID] AND A.[LOBId] = B.[LOBId] AND A.[TypeId] = B.[TypeId]
)
WHEN MATCHED THEN
UPDATE
SET A.[PropertyTypeId] = B.[PropertyTypeId]
,A.[PropertyTypeName] = B.[PropertyTypeName]
,A.[DefaultPropertyValue] = B.[DefaultPropertyValue]
,A.[PropertyTypeDisplayName] = B.[PropertyTypeDisplayName]
,A.[Guid] = B.[Guid]
WHEN NOT MATCHED THEN
INSERT
(
[ID]
,[LOBID]
,[TypeId]
,[PropertyTypeId]
,[PropertyTypeName]
,[DefaultPropertyValue]
,[PropertyTypeDisplayName]
,[Guid]
)
VALUES
(
B.[ID]
,B.[LOBID]
,B.[TypeId]
,B.[PropertyTypeId]
,B.[PropertyTypeName]
,B.[DefaultPropertyValue]
,B.[PropertyTypeDisplayName]
,B.[Guid]
);
No comments:
Post a Comment