NEWBIE - Checking for existance of a SQL user
Posted: Wed 06 Jul 2016 08:38
Hi Guys.
Now go easy on me...I'm new to all this...hope I'm explaining this right....
I want my Delphi App to check for a user, if not found add that user complete with security dbRoles.
I want my Delphi App to check SQL Server Security DB for the existance of a user which I can do, however, how do i get this info back into Delphi so that I can act on it.
var NoUserExists : boolean;
Query.SQL.Clear;
Query.SQL.Add('IF SUSER_ID('''+thisuser+''') IS NULL) ; // can't do anything else here until executed...
RoleQuery.Execute;
Now go easy on me...I'm new to all this...hope I'm explaining this right....
I want my Delphi App to check for a user, if not found add that user complete with security dbRoles.
I want my Delphi App to check SQL Server Security DB for the existance of a user which I can do, however, how do i get this info back into Delphi so that I can act on it.
var NoUserExists : boolean;
Query.SQL.Clear;
Query.SQL.Add('IF SUSER_ID('''+thisuser+''') IS NULL) ; // can't do anything else here until executed...
RoleQuery.Execute;