Here is an excellent read on the subject:
http://msdn.microsoft.com/en-us/library/aa259228(v=sql.80).aspx
Scroll down a little more than half the page to see examples.
Here is a quick example:
SET QUOTED_IDENTIFIER OFF
DECLARE @Toff VARCHAR(100)
SET @Toff = 'I''ve got a lovely bunch of cocnuts'
SELECT @Toff
Result:
I've got a lovely bunch of cocnuts
edited to take result out of code block