def login_exists(login, **kwargs):
 try:
  return (len(tsql_query(query="SELECT name FROM sys.syslogins WHERE name='{0}'".format(login), **kwargs)) == 1)
 except Exception as e:
  return 'Could not find the login: {0}'.format(e)

def login_exists ( login , ** kwargs ) : try : return ( len ( tsql_query ( query = "SELECT name FROM sys.syslogins WHERE name='{0}'" . format ( login ) , ** kwargs ) ) == 1 ) except Exception as e : return 'Could not find the login: {0}' . format ( e )
find if a login exists in the ms sql server .