Escaping a single quote in SQL Server 2005 I am using SQL server 2005 and using the northwind database. I need the supplier id of  Grandma Kelly's Homestead and I used this query:

select supplierid from suppliers
where companyname ='Grandma Kelly''s'' Homestead'


I checked the link Escaping a single quote in SQL Server, but I can't find an answer.

I used the two single quotes but it didn't work since the query is executing but it doesn't return a value. 

How can I escape the single quote and retrieve the value? I would also like to know how to insert the values into the table having quotes
I think you just meant:

select supplierid from dbo.suppliers
where companyname ='Grandma Kelly''s Homestead';


(In other words, there was only one apostrophe to replace.)