Escaping a single quote in SQL Server The recommendations I have come across advise that single quotes in SQL Server should be escaped using two single quotes. Thus Ravi's becomes Ravi''s. 

Another alternative is to use parameters. 

In most of the examples I have seen the words usually have only one quote. Most times it works but I have been unable to make it work while creating a database login.

CREATE LOGIN Ng''ang''a  WITH PASSWORD  'Ng''0ng''0' 


Where I am going wrong?
The user name is an ID/QUOTED ID that should be enclosed in double quotes or square brackets while the password is a regular string where single quotes need to be doubled. The correct syntax would in other words be;

CREATE LOGIN "Ng'ang'a" WITH PASSWORD='Ng''0ng''0'


or

CREATE LOGIN [Ng'ang'a] WITH PASSWORD='Ng''0ng''0'