Hi,
for ETL-Processing i need a function, who check all columns in all tables with spec. Name (see code) and Data_Type nvarchar. If the Value isn't a valid Dateformat, then printout....
The Datatype is allways nvarchar (because its a staging table)
I have a little codesnippet addet...
Thanks
Regards Nicole
;with cte
AS
(
SELECT COLUMN_NAME, TABLE_NAME, DATA_TYPE
FROM INFORMATION_SCHEMA.COLUMNS
WHERE (COLUMN_NAME LIKE '%date%' or COLUMN_NAME like '%create%')
and DATA_TYPE = 'nvarchar'
)
Select all columns from all cte.tables where column.value != korrekt Dateformat;