Update String Columns without Using Single Quotations - General Question

Posted by peace on Stack Overflow See other posts from Stack Overflow or by peace
Published on 2010-05-30T12:26:41Z Indexed on 2010/05/30 12:32 UTC
Read the original article Hit count: 261

Filed under:
|
|
|
UPDATE CustomerPhone 
SET PhoneTypeID = 7, PhoneNumber = 999-444
WHERE CustomerID = 500 AND PhoneNumber = 9-1-1;

PhoneNumber is of type varchar(20) whereas PhoneTypeID and CustomerID are of type int. I'm running the above statement in SQL Server, it works fine.

I wonder how come it works? I thought any string value has to be put between '...'

© Stack Overflow or respective owner

Related posts about sql-server

Related posts about database