|
SOUNDEX is the standard way of handling phonetic searches in Sql Server but it can return lots of false matches.
|
|
|
|
|
Hi,
IMO you can solve such problems by using a "canonical form"; for each possible value, the canonical value should be defined somehow, in your example it could be the alphabetically first of all equivalent names, so in your Jassim example it would be Jasem. So you store the original value (Jassim) and the canonical value (Jasem); when a search is launched for say Jasim, you look up or compute its canonical value (again Jasem) and launch a search for that canonical value.
Again in your example, the canonical form would probably be defined by a database table, which also means you can store its unique ID rather than its string value.
Luc Pattyn [Forum Guidelines] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Hi,
I agree with Mr. Russel that though soundex will help in such situations but it will cause problems on the other hand by delivering extra results.
I suggest better use Metaphone(which was first described by Lawrence Philips in the December 1990 edition of Computer Language magazine) for serving your purpose
Look here for SQL Version
Metaphone (Simple and Double)
and here for Oracle Version(You will find the code in Listing A)
Consider algorithms other than Soundex
Hope this helps
Niladri Biswas
|
|
|
|
|
SOUNDEX function is the simplest way to start. But it matches only based on phonetic similarities. For example, 'Mohammed' and 'Mohamed' will match but not 'Mohd', since it has a completely different pronounciation. You need to write your own function to take care of such cases, probably by storing canonical forms of common names and comparing it with the input.
|
|
|
|
|
As noted by other posters, soundex is the easiest solution although it may not always work quite as expected.
A better "fuzzy matching" algorithm is the Levenstein algorithm which is pretty good, but you would probably have to code up your own solution for that and it might be a challenge to get it to perform over a large database. (Plenty of articles available if you Google for it.)
Or, you could use a full text search engine like Lucene or MS Search Server which might be overkill for you but which do have some nice built-in fuzzy search support. (They are intended for searching documents but you can get adaptors to run them over relational databases as well.)
|
|
|
|
|
Hi All ,
I'm beganer in SQL ,and I'm going to install aplication in the coustomer PC .My boss ask me to install Microsoft SQL Server 2005 Client version in the customer pc.
my qustion is , what is the "Microsoft SQL Server 2005 Client version"? is it the sql native client or not?
form where can i install it ? and how? is it free?
Many thanks,
|
|
|
|
|
Take a look at the information on Microsoft's SQL site[^], where you should be able to find what you need. I am not aware of a "client version" of SQL 2005 so you may need to clarify what it is that you will be running on the client PC. I assume that you already have the SQL Server installed somewhere.
|
|
|
|
|
If the client is to query your database from his own SQL Server, then SQL Server Compact or Express Edition might be needed. See http://www.microsoft.com/sqlserver/2008/en/us/editions.aspx
If you use non-generic connection strings in your project (e.g. a different vendor's OLE DB provider for SQL Server 2008) and installed a driver, then you might need to download the appropriate drivers to the client machine.
|
|
|
|
|
A database client is a desktop application that can be used to query a database. If the database is on a server that can be accessed over a network, your just need to install the client and connect to the server. For SQL Server, the most commonly used client is the SQL Server Management Studio (SSMS).
|
|
|
|
|
|
1) Is it possible to write queries using ADO on an in-memory System::DataTable that is not loaded in the database? Part of my motivation is that I may download a datasets from a website for one-time use, such as intraday equity data.
2) Is it possible to create a new table in a database from ADO's System::DataTable? For example, I've found that the same code might not work for creating an identity column in SQL Server, Oracle, and DB2.
---this works in DB2, but not Sql Server for example
CREATE TABLE ABBREV_LIST
( ID_NO INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1, NO CACHE ) ,
ABBREV CHARACTER(4) NOT NULL CONSTRAINT UPPER_ABBREV CHECK (ABBREV = UPPER(ABBREV)),
PRIMARY KEY ( ID_NO ) )
|
|
|
|
|
You can't run sql against datasets but you can use Linq to DataSets instead.
|
|
|
|
|
Hello, I am looking at encryption in SQL Server 2008. I have the basics down but have a question about sizing the encrypted column.
I have two columns of data I want to encrypt. One 9 characters and one 20 characters. Currently VARCHAR(9) and VARCHAR(20). (Yes I know that the VAR means space savings.) What is the minimum VARBINARY needed for these, or a better question how do I calculate the VARBINARY size?
Thank you,
djj
|
|
|
|
|
Two suggestions.
1. SQL Server 2008 has built in encryption, why not use that?
2. Why not simply do a few tests to determine what size you need?
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
The built in encryption is what I am looking at, at least I am using the BOL how to.
As to the tests I will do that but it would be nice to have an equation to calculate it.
djj
|
|
|
|
|
I am using SSRS 2008 in my application. For some items the item description contain the data as "5X7" DISNEY POSTCARD" in database. When I do the export to csv file in SSRS 2008 the text displayed as "5X7 DISNEY POSTCARD"" in csv file, it is placing the double qoute at the end of the text instead where it should be.
Please any one help me on this, I am running out of time.
Thanks in advance
-D
|
|
|
|
|
You have a problem that is probably not solvable, CSV/Excel/MS converters use the " character as the text delimiter and probably wraps the entire text field in ". Embedded quotes are probably not going to be supported, certainly in CSV where it is a control character.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
While doing a little maintenance on a database that keeps track of reclosers (devices used in electrical substations), I tried adding a field to a table using the Management Studio on the server. No go - I don't have permission, and have no idea where to change that. So I switched to the client, opened Visual Studio, connected to the same database on the server, and proceeded to add new fields without a problem. In both instances I was logged in as the same domain user, with admin priveleges. It's not intuitively obvious to me why a remote user using Visual Studio has access priveleges greater than an administrator on the local server using the management tool designed for SQL Server. Can someone explain this odd behavior? I really think - especially once I complete an app to use this data - that this situation should be reversed, but I have no idea how to do so.
Thanks!
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
i understood the first part of your question but got lost in the last question. First Question when you logged into SQl management Studio did you use Windows Authentication to log in ? if yes, your user did not have permission. log in as a "sa" user or a user that has sysadmin permission in that sql instance and add the domain user and give him appropriate permissions and you will be able to add the field there. Your Resolution was to go the VS route which is not a good idea in most cases.the Reaons that you were able to add the field was that someone with permissions once created that and now it is always there it does not even ask you for username and passowrds, you just use it. i used to do that too. The last part of your question i did not understand
It's not intuitively obvious to me why a remote user using Visual Studio has access priveleges greater than an administrator on the local server using the management tool designed for SQL Server. Can someone explain this odd behavior? I really think - especially once I complete an app to use this data - that this situation should be reversed, but I have no idea how to do so.
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Thanks, but I think Shameel has hit the nail on the head.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
Cool
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
If you are very sure that you used the same credentials in both instances, then it could be a setting in SSMS that prevents changes to tables that require the table to be recreated.
Click Tools --> Options
Under Designers --> Table and Database designers, there is an option "Prevent saving changes that require table re-creation".
Ensure that this option is unchecked. It is checked by default.
|
|
|
|
|
Thanks!
I generally don't mess with default settings until I'm familiar with the product, and that's one I haven't changed.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
Had the same problem today. I am getting into 2008 from 2000 and did not know where to find that setting.
Thanks Shameel
by the way I just noticed the Get Smart quote
djj
|
|
|
|
|
I'm on a roll here, so bear with me.
I haven't used it before, and want to learn it quickly. I particularly want to use it with C# applications for tracking equipment and service records for work. I also happen to have a few bucks available and I'm in the mood to buy myself a Christmas present. A book would be nice, particularly a book that covers programming for SQL Server 2008 in C#, and which will also teach me about n-tier development - breaking the task into logical units for data access, business rules, and user interfaces. I tend to get them all muddled together in one mess, and you know what that leads to... another project I never finished. I'd like to be done with that, once and for all.
Any favorites?
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|