I have a database that I am migrating to SQL Azure. There are a couple of stored procedures in this database that rely on ContainsTable. From my understanding, SQL Azure does not support this. Because of this, I was hoping there would be a way to imitate this functionality in C# code.
Does anyone know how to either: a) Utilize ContainsTable in SQL Azure or b) Imitate it in C# code?
Full-Text Search is available in Premium, Standard and Basic service tiers in Azure SQL Database V12. You can start using it immediately on your databases as there is no other service configuration necessary.
For a full-text index to be created on a table, the table must have a single, unique nonnull column. You can build a full-text index on columns of type char, varchar, nchar, nvarchar, text, ntext, image, xml, varbinary, and varbinary(max) can be indexed for full-text search.
SQL Server databases are full-text enabled by default. Before you can run full-text queries, however, you must create a full text catalog and create a full-text index on the tables or indexed views you want to search.
The basic steps are: 1) Create a fulltext index over the column. This will tokenise each string (stremmers, splitters, etc) and let you search for 'LIKE THIS' strings. The disclaimer is that I've never had to use it but I think it can do what you want.
Yes, you are right that Contains Table are not supported on SQL Azure as described here.
Based on your question a) is not possible however b) is possible using Lucene.NET.
IF you wish to use code to get full text search in SQL Azure you would need to use Lucene.net in a web or worker role to index your SQL Azure data to Windows Azure Blob storage and then access the indexed data to search. The process is described as below:
Here is an article to start your work: How to Use Lucene.NET with SQL Azure (en-US)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With