User talk:JendaMuky

DECLARE @sql NVARCHAR(MAX); SET @sql = N'';

SELECT @sql = @sql + N' ALTER TABLE ' + QUOTENAME(s.name) + N'.' + QUOTENAME(t.name) + N' DROP CONSTRAINT ' + QUOTENAME(c.name) + ';' FROM sys.objects AS c INNER JOIN sys.tables AS t ON c.parent_object_id = t.[object_id] INNER JOIN sys.schemas AS s ON t.[schema_id] = s.[schema_id] WHERE c.[type] IN ('D','C','F','PK','UQ') ORDER BY c.[type];

PRINT @sql; --EXEC sys.sp_executesql @sql;

CREATE VIEW DWH_L1.dbo.V_DWD_COUNTRY_SRC ( NAME  , CODE   , SEQ   , ZIP_CODE_PATTERN   , IS_EU_MEMBER   , ISO3   , AML_STATUS   , SOURCE_ID   , SRC_SYSTEM_ID   , BATCH_NO ) AS SELECT NAME , CODE , SEQ , ZIP_CODE_PATTERN , IS_EU_MEMBER , ISO3 , AML_STATUS , cast(country_id as varchar(50)) , `JACHYM` , BATCH_NO FROM L0.dbo.JACHYM_COUNTRY ;

///