I want to insert a string with trademark symbol (™) to MSSQL 2008.
When I was searching the problem I found some SQL based solutions:
Trimming the symbol:
SELECT REPLACE('Microsoft™',char(153),'')
Insert only the symbol:
INSERT mytable(col1) VALUES (char(153))
Also I have read this question but I can't find a solution.
Is there any way to insert a word with the symbol (like 'Microsoft™') using Linq to SQL?
I made my trials on a nvarchar column.
Edit:
This is my table:
This is my mapping at dbml:
This is my code:
var db = new DBDataContext();
Seller seller;
if(!db.GetTable<Seller>().Any(s => s.Username == username))
{
seller = new Seller {Username = username, SellerName = name, FeedbackCount = feedback};
db.Sellers.InsertOnSubmit(seller);
db.SubmitChanges();
}
This is what I want to insert as an name: B♥Râ™
And This is the generated SQL:
INSERT INTO [dbo].[Sellers]([Username], [SellerName], [FeedbackCount])
VALUES (@p0, @p1, @p2)
SELECT CONVERT(Int,SCOPE_IDENTITY()) AS [value]
-- @p0: Input VarChar (Size = 8000; Prec = 0; Scale = 0) [testuser]
-- @p1: Input NVarChar (Size = 4000; Prec = 0; Scale = 0) [B♥Râ™]
-- @p2: Input Int (Size = -1; Prec = 0; Scale = 0) [886]
-- Context: SqlProvider(Sql2008) Model: AttributedMetaModel Build: 4.0.30319.17929