How to Check if a login exists in SQL Server ?


This content was proof-read by Grammarly. You can Try Grammary for FREE

If you need to check if a login exists in SQL Server , you can use query the master.dbo.syslogins for it.

How to Check if a login exists in SQL Server ?

Here’s a sample query demonstrating how you can query master.dbo.syslogins to find out if the login exists in SQL Server.

Select * from master.dbo.syslogins 
where name = 'sa'

This would retreive all the details of the loginid ‘sa’.

image
Newsletter Signup

Subscribe to our weekly newsletter below and never miss the latest product or an exclusive offer.

Newsletter Signup

Subscribe to our weekly newsletter below and never miss the latest product or an exclusive offer.

%d bloggers like this: