set@Subtable='[table that uses id from source table]'
set@Roottable='[source table]'
set@idColumn='[idColumnName]'
SET@SQLStatement='SELECT * FROM '+@Subtable+' as st '+' where not exists(select * from '+@Roottable+' as rt where st.'+@idColumn+'=rt.'+@idColumn+')and '+@idColumn+' is not null'
Geen opmerkingen:
Een reactie posten