|
We are discussing a new project that will do lots of word matching, including some fuzzy logic in the matching.
We are deciding between using SQL and ACL for this job, and I've been told that SQL has more fuzzy logic facilities than ACL.
Anyone know about this or what the additional fuzzy facilities are?
Thanks in advance - Ben
|
|
|
|
|
That's a pretty broad assumption. What variant of SQL database are you talking about here, because different engines have different features?
|
|
|
|
|
Currently we're using Microsoft SQL Server 2008 but could upgrade to the latest for this project.
|
|
|
|
|
At the most basic, you're talking about Soundex matching, which isn't great. You might want to consider Full Text Indexing, which will return misspelled items if they are close enough. Of course, you can always implement your own fuzzy logic inside SQL Server, using CLR functions.
|
|
|
|
|
I have the following query:
select CASE when EA.Address1 <> '' and EA.Address2 <> '' and EA.Address3 <> '' then Replace(EA.Address2, ',' , ' ') + '' + Replace(EA.Address3, ',' , ' ')
else EA.Address1 end as employeeaddress
from EmployeeAdress EA
However employeeaddress should hold a maximum of 35 characters irrespective the number of characters in columns Address1, Address2, Address3.
Any advice how to do this?
Thanks
Berba
|
|
|
|
|
Try:
SELECT LEFT(CASE ... END, 35) As EmployeeAddress ...
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks. It works
|
|
|
|
|
Hi All,
We want to disable the windows authentication mode in the sql server, because we use the sql authentication and we don't want the user to login from the management studio using windows authentication.
so we need a sql script to disable the windows authentication from our windows application, what is the script please.
Thanks all
|
|
|
|
|
|
Rather certain that isn't possible nor logically advisable.
SQL Server supports Windows authentication and as an option SQL identification. The later is an option the former isn't.
Additionally you seem to think that you can disallow access to SQL server completely. Which suggests that you think that there will never be problems that need investigation. Which is unlikely to be true.
If you don't trust your users then either address that at the management level or the contract level. And don't try to solve it with technology.
|
|
|
|
|
|
Hi, I was given a tricky challenge question to attempt and allowed the use of any resources at my disposal. So far all my attempts have produced results close to the expected output but not quiet the expected out put. Here's the link to the question: Question and here's where you can test your query: test here.
Here's my query that produced the closest results:
SELECT DISTINCT Competencies.CompName AS compname, Users.FirstName AS firstname, Users.SurName AS surname, CompPos.Level AS positionlevel, CompUser.Level AS userlevel
FROM Positions INNER JOIN CompPos
ON Positions.PosId = CompPos.PosID
INNER JOIN Competencies
ON CompPos.CompID = Competencies.CompID
INNER JOIN CompUser
ON Competencies.CompID = CompUser.CompID
CROSS JOIN Users
WHERE (Users.UserId IN ('999209', 'helpdesk1', '999339', 'helpdesk5', '999827'))
AND (CompUser.UserID IN ('999209', 'helpdesk1', '999339', 'helpdesk5', '999827'))
AND (Positions.Position LIKE '%Corp HR-People Development-Wellness-Manager(Process)%')
ORDER BY CompPos.Level DESC, Competencies.CompName, CompUser.Level, Users.FirstName, Users.SurName
|
|
|
|
|
Website wrote: I only want to see results for users with the following userids '999209','helpdesk1','999339','helpdesk5','999827'
Even if they don’t have records in compuser.
"Want"? How about learning SQL, breaking the problem into smaller pieces?
..and no, it's generally not a good idea to have a server open like that; it's obvious that you're running Sql Server, and one can request a list of all the databases in there.
Ever heard of Bobby Tables[^]? "All input is evil until proven otherwise".
|
|
|
|
|
Eddy Vluggen wrote: ..and no, it's generally not a good idea to have a server open like that; it's
obvious that you're running Sql Server, and one can request a list of all the
databases in there.
From the question I would guess that the OP doesn't own the database server.
|
|
|
|
|
Please try this one, if this helps, u might need to do some modification.
=============
select Competencies.CompName AS compname, Users.FirstName AS firstname, Users.SurName AS surname, CompPos.Level AS positionlevel, CompUser.Level AS userlevel from Users
left outer join compuser
on users.userid = compuser.userid
left outer join Competencies
on compuser.compid = Competencies.compid
left outer join CompPos
on CompPos.compid = Competencies.compid
left outer join Positions
on Positions.posid = CompPos.posid and Positions.Position LIKE '%Corp HR-People Development-Wellness-Manager(Process)%'
WHERE Users.UserId IN ('999209', 'helpdesk1', '999339', 'helpdesk5', '999827')
--and Positions.Position LIKE '%Corp HR-People Development-Wellness-Manager(Process)%'
ORDER BY CompPos.Level DESC, Competencies.CompName, CompUser.Level, Users.FirstName, Users.SurName
|
|
|
|
|
Hello. I am developing a small project in C#, in which I show chosen passages from a book.
Now I am not sure how do I store these passages in database? Currently I am considering these two options
1 - Storing passages as pictures in folders BUT their paths in the database. My application will get these paths and load the content in the window.
2 - Storing the actual text content in the database and load it in the window.
Can you please help me decide which way is better? Or is there any better way to do it? Thanks
This world is going to explode due to international politics, SOON.
|
|
|
|
|
Probably 2 but it could be 1.
Some examples for 1.
- text from illuminated book
- ancient text whose translation is in doubt
- legal documents where originals matter
|
|
|
|
|
Storing an image will give you the least amount of useful data, storing the text allows it to be searchable.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
AmbiguousName wrote: Can you please help me decide which way is better?
There is no "better" way; each has it's own advantages and disadvantages, and you'd need to check your requirements which suits better.
On a folder;
- You can have clashes in naming. Filenames must be unique.
- You have the advantage of the virusscanner picking things up. Most scanners don't do databases.
- You track an external asset
In a database;
- Easy with backups/restores; are you gonna backup that folder?
- Centralized; no need to document outside-repositories
- As easy to (hyper)link to as a document on a webserver. However, not being a file, the server cannot response to a header-request on it's freshness.
|
|
|
|
|
Plz try this...
http://stackoverflow.com/questions/5095533/storing-a-book-using-sql-server
|
|
|
|
|
my stored procedure is :
USE [CRM-CMSAlmas]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[tblVacationDaily_GetAllDetailsSenderReciverbyRecordIdANDJobIdAndStepId]
(@RecordId INT,@JobId INT,@StepId int)
AS
BEGIN
SELECT WF.Cartable.JobId, Forms.tblVacationDaily.Id, Forms.tblVacationDaily.IsWorkFlow, Forms.tblVacationDaily.CreateUserID,
Forms.tblVacationDaily.CreateDate, Forms.tblVacationDaily.StepId, Forms.tblVacationDaily.RecordId, Forms.tblVacationDaily.OrderId, Forms.tblVacationDaily.PersonId,
WF.Cartable.ForwardedUserId, WF.Cartable.RecieveUserId, WF.Cartable.IsDeleted, p1.FullName AS RecieveUserName, p2.FullName AS ForwardedUserName,
WF.Cartable.IsBack
FROM WF.Cartable INNER JOIN
WF.JobFormConjuction ON WF.JobFormConjuction.JobId = WF.Cartable.JobId INNER JOIN
Forms.tblVacationDaily ON Forms.tblVacationDaily.RecordId = WF.JobFormConjuction.RecordId AND Forms.tblVacationDaily.StepId = WF.Cartable.StepID - 1 INNER JOIN
Persons.People AS p1 ON p1.Id = WF.Cartable.RecieveUserId INNER JOIN
Persons.People AS p2 ON p2.Id = WF.Cartable.ForwardedUserId
WHERE (Forms.tblVacationDaily.RecordId = @RecordId) AND (WF.Cartable.JobId = @JobId) AND (Forms.tblVacationDaily.StepId<=@StepId)
END
but when i use <pre lang="SQL">EXEC sp_helptext [dbo.tblVacationDaily_GetAllDetailsSenderReciverbyRecordIdANDJobIdAndStepId]</pre><br />
<br />
the result is :[Note: I have change Create ----> Alert
Alter PROCEDURE [dbo].[tblVacationDaily_GetAllDetailsforSenderAndReciversbyRecordIdANDJobId]
(@RecordId INT,@JobId INT,@StepId int)
AS
BEGIN
SELECT WF.Cartable.JobId, Forms.tblVacationDaily.Id, Forms.tblVacationDaily.IsWorkFlow, Forms.tblVacationDaily.CreateUserID,
Forms.tblVacationDaily.CreateDate, Forms.tblVacationDaily.StepId, Forms.tblVacationDaily.RecordId, Forms.tblVacationDaily.OrderId, Forms.tblVacationDaily.PersonId,
WF.Cartable.ForwardedUserId, WF.Cartable.RecieveUserId, WF.Cartable.IsDeleted, p1.FullName AS RecieveUserName, p2.FullName AS ForwardedUserName,
WF.Cartable.IsBack
FROM WF.Cartable INNER JOIN
WF.JobFormConjuction ON WF.JobFormConjuction.JobId = WF.Cartable.JobId INNER JOIN
Forms.tblVacationDaily ON Forms.tblVacationDaily.RecordId = WF.JobFormConjuction.RecordId AND Forms.tblVacationDaily.StepId = WF.Cartable.StepID - 1 INNER JOIN
Persons.People AS p1 ON p1.Id = WF.Cartable.RecieveUserId INNER JOIN
Persons.People AS p2 ON p2.Id = WF.Cartable.ForwardedUserId
WHERE (Forms.tblVacationDaily.RecordId = @RecordId) AND (WF.Cartable.JobId = @JobId) AND (Forms.tblVacationDaily.StepId<=@StepId)
END
Go
Now the BUG/ERROR :
The content is same but the names are diffrent :
[dbo].[tblVacationDaily_GetAllDetailsforSenderAndReciversbyRecordIdANDJobId]
but the sp is :
[dbo].[tblVacationDaily_GetAllDetailsSenderReciverbyRecordIdANDJobIdAndStepId]
why the names are different ?
|
|
|
|
|
You probably renamed the proc and the sp_help has not refreshed the name.
If one of my devs named a proc like that he would get a first warning, there would be no second.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks in advanced but the sp was renamed before and now its working properly!
but when i right click the sp and click on modify is diffrent from sp_helptext. and event the name of it in sp list is also different from sp_helptext !
But i dont get why this is happing@
|
|
|
|
|
Try updating your statistics, "UPDATE STATISTICS..." This may not do anything but it might help
|
|
|
|
|
|