Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Allow special characters SQL Server 2008

I am using SQL Server 2008 express edition and its collation settings are set to default.I wish to store special characeters like á ,â ,ã ,å ,ā ,ă ,ą ,ǻ in my database but it converts them into normal characters like 'a'. How can I stop SQL Server from doing so?

like image 257
Rahul Avatar asked Oct 27 '09 05:10

Rahul


People also ask

How do I allow special characters in SQL Server?

Make sure that your columns are using the type nvarchar(...), rather than varchar(...). The former is Unicode, the latter is ASCII. Also, make sure that your database default collation is set to Accent Sensitive, and that your columns are stored that way.

Does varchar allow special characters in SQL Server?

So what is varchar in SQL? As the name suggests, varchar means character data that is varying. Also known as Variable Character, it is an indeterminate length string data type. It can hold numbers, letters and special characters.

Which special characters are not allowed in SQL?

Names can contain (but cannot begin with) the following special characters: 0 through 9, #, @, and $.


1 Answers

Make sure that your columns are using the type nvarchar(...), rather than varchar(...). The former is Unicode, the latter is ASCII.

Also, make sure that your database default collation is set to Accent Sensitive, and that your columns are stored that way. You may also want to check your instance default collation, as that affects the default collation for your system databases, particularly tempdb.

like image 111
Rob Farley Avatar answered Oct 09 '22 21:10

Rob Farley