Situatie
Mai jos este o procedura care returneaza userii creati pe un server de sql in ultimele x zile, unde x este un parametru al procedurii.
Solutie
— exec LoginsCreatedInLastXDays_prc 2
alter procedure LoginsCreatedInLastXDays_prc
@X int
as
Select
name,
type_desc,
create_date,
is_disabled,
modify_date,
default_database_name
from sys.server_principals
Where
create_date >= GETDATE()- @X
Leave A Comment?