Showing posts with label spaces. Show all posts
Showing posts with label spaces. Show all posts

Wednesday, March 21, 2012

Fuzzy grouping matching nulls to empty strings/spaces

Will the fuzzy grouping task match a null value to an empty string (or spaces)? I've got 5 columns I'm matching on, and one of them may be null for certain rows but an empty string for others. Given the 4 other columns may match, will this difference stop similar columns being grouped together?

(Someone's modified my grouped data since it was deduped, which takes a while, and I'm hoping for a quick answer on this).

Thanks in advance.

Ben

Not sure, but building a quick package and adding a data viewer should give you the answer.

I would hope that a NULL wouldn't match to spaces...

Couldn't you run an update query to "fix" the data?|||

Computer says "no"

<cough>

No duplicate matching between null and empty string/spaces, as you suspected. Thanks for the idea of the quick test - seems obvious in retrospect, if only it had been beforehand Smile Unfortunately I can't fix the data, other than rerunning the grouping task, but good to know the source of the problem - thanks Phil!

Friday, March 9, 2012

Function like Len() that counts white space

Good day to you, community friend!

Just a quick one - I swear I've seen a function before that was like Len() but it counted the white spaces too. I have a feeling it was something along the lines of "data_length" but I can't for the life of me find it!

Many thanks,
GeorgeSkip the underscore.|||I knew it was something that simple!!
Cheers keffenils :)|||I appear to have slipped a cog or two here. Can someone explain what georgev meant based on:DECLARE @.c VARCHAR(50)

SELECT @.c = 'This is a test'

SELECT Len(@.c), DataLength(@.c), @.c AS '12345678901234567890'-PatP|||DECLARE @.c VARCHAR(50)

SELECT @.c ='This is a test '

SELECTLen(@.c),DataLength(@.c), @.c AS'12345678901234567890'

:)|||Ah ha! I keep thinking like SQL Server, so trailing whitespace isn't really there in my mind... This was actually a user-required concession to make CHAR() columns function the way that microcomputer programmers expected them to, long before Microsoft inherited the product.

-PatP|||The trailing spaces are maintained in SQL Server CHAR columns. It is the LEN function that ignores them when returning a value.|||The trailing spaces are maintained in SQL Server CHAR columns. It is the LEN function that ignores them when returning a value.That's what I thought I said.

Somewhere prior to 4.0, spaces were left "as is" by functions, including trailing spaces. By the time that 4.21 was released, all of the string functions were supposed to trim trailing spaces before processing, and convert any string results back into the CHAR() type if that is what the function had originally been passed.

-PatP

Friday, February 24, 2012

Full-Text Search on Multiple Tables & Columns

Hi,

I have tried this code fromhttp://jtkane.spaces.live.com/Blog/cns!1pWDBCiDX1uvH5ATJmNCVLPQ!316.entry for full-text search on multiple tables & columns.

Here's my code:

SELECT * from [tStaffDir] AS e, [tStaffDir_PrevEmp] t,
CONTAINSTABLE([tStaffDir], *, @.Name) as A
where
A.[KEY] = e.[ID] and
t.[ID] = e.[ID]

I have FT the both the tables above and I am able to get results from the [tStaffDir] table but not the [tStaffDir_PrevEmp] table.
The [tStaffDir_PrevEmp] table does have a column (which is [ID]) that is indexed, unique and non-Nullable.

Please advise what I should do and look out for.

Many Thanks.

Will appreciate if anyone can advise. Thanks.|||

Seems like I am not able to get a answer.

Anyone able to point me in the correct direction?