June 13, 2012

sp_validatelogins (Transact-SQL MetaData) Definition

Please note: that the following source code is provided and copyrighted by Microsoft and is for educational purpose only.
The meta data is from an SQL 2012 Server.

I have posted alot more, find the whole list here.

Goto Definition or MetaData

Definition:

sys.sp_validatelogins()

MetaData:

 create procedure sys.sp_validatelogins  
AS
-- Must be securityadmin (or sysadmin) to execute
if is_srvrolemember('securityadmin') = 0 and is_srvrolemember('sysadmin') = 0
begin
raiserror(15247,-1,-1)
return 1
end

-- Use get_sid() to determine if nt name is still valid (builtin is only available from system procs!)
select 'SID' = sid, 'NT Login' = loginname from master.dbo.syslogins
where isntname = 1 and get_sid(loginname) is null
return 0 -- sp_validatelogins

No comments:

Post a Comment

Total Pageviews