How to delete a user from command line when username contains spaces
hello there- I need to setup a script but I am not able to delete users using sp_dropuser when username contains a space. Any help would be highly appreciated. example - sp_dropuser [AMR\Business Apps- PSFIN Security Team] Thanks, Deep
Wrap the whole command in double quotes: "exec sp_dropuser [AMRBusiness Apps- PSFIN Security Team];" This is the standard way to do this with respect to the command prompt. For instance: cd "\Program Files"
Have you tried quoting the parameter: exec sp_dropuser 'AMRBusiness Apps-PSFIN Security Team'; And if that doesn't work, then try square brackets as well: exec sp_dropuser '[AMRBusiness Apps-PSFIN Security Team]';