Friday 27 January, 2012

Inserting single quote i.e., ' into a column of sql server table


Declare @TempTable Table(ID int,[Name] nvarchar(20));


Insert into @TempTable values(1,'Vinay''s Computer');

Insert into @TempTable values(2,'Arun''s sister');

Insert into @TempTable values(3,'Radha''s pen');


Select * from @TempTable;



Out put:


ID      Name
--      ----------------
1 Vinay's Computer
2 Arun's sister
3 Radha's pen



Tag: 2005, insert, into, quote, single, single quotes, sql, Sql server, statement, table, temporary table

No comments:

Post a Comment

Parsing JSON w/ @ symbol in it

To read the json response like bellow @ concatenated with attribute                             '{ "@id": 1001, "@name&q...