Question

Trying to import a database structure from SQLite to SQL Server 2008 R2 Express. How do I define the following SQLite syntax in my SQL Server CREATE TABLE script?

vendor_no VARCHAR(255) COLLATE NOCASE

I checked the MSDN page on collations but it has way too many entries and many of them look very similar. The database is in US-English environment if that matters.

Was it helpful?

Solution

SQLlite has only one built-in collation (Binary), 'nocase' just makes the binary collation case-insensitive. SQL Server has collations for many different alphabets, most of them in both versions (CI - case insensitive and CS - case sensitive). It's not a great idea to mix collations in SQL Server, as this is prone to errors due to implicit conversion in many operations (e.g. join, union, etc).

What you can do is check the collation in your databases to make sure is case insensitive:

SELECT name, collation_name FROM sys.databases

is likely that this query returns: SQL_Latin1_General_CP1_CI_AS (US English case insensitive) but you just need to make sure it shows something like ...CI...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top