I am running the following code to extract all relevant rows from all tables that have a particular column. The outer IF
is supposed to check if the column exists o
Please try this dynamic sql. remove comment from exec
when you are ready to run
declare @t varchar(max) = ''
SELECT @t = @t + 'SELECT * FROM ' + a.name + ' WHERE GCRecord IS NOT NULL;' + char(13)
FROM sys.columns b join sys.objects a on
b.Object_ID = a.Object_ID
WHERE b.Name ='CreateDt'
Print @t
--exec (@t)