Situatie
Mai jos este o procedura ce listeaza toate tabelele care nu contin nicio coloana de tip identity, de pe baza pe care este rulata.
Solutie
create procedure ListTablesWoIdentity_prc
as
select table_name
from information_schema.tables
where
table_name not in
(select c.table_name
from information_schema.columns c
join sys.identity_columns ic
on c.column_name = ic.name
)
and table_type = ‘base table’;
Leave A Comment?