SQLTeam.com | Weblogs | Forums

Floating Fields


#1

I can't remember how to fix this. I want to join this one table using the TIN field, but I am getting this error. Is there an easy fix for this. I did this before, but I can't remember.

This is the error I am getting.

Msg 8114, Level 16, State 5, Line 2
Error converting data type varchar to float.

Select Distinct
TIN,
[Provider First],
[Provider MI],
[Provider Last]
from [dbo].[Excela]
Inner join IMPact.dbo.pcsa on pcsa_tax1 = TIN
and pcsa_lname = [Provider First] and pcsa_fname = [Provider Last]
join impact.dbo.pcsp on pcsa_id1 = pcsp_id1 and pcsa_id2 = pcsp_id2
left join impact.dbo.pcs on pcsa_id1 = pcs_id1
where
pcsp_trm is null


#2

One of the columns in the joins is float while you are comparing it to a VARCHAR. Without DDL i do not know which is the problem. I would guess TIN versus pcsa_tax1 you could use CAST(TIN AS VARCHAR(20), if that is your float.


#3

If the TINs are in plain text or plain numerics, you folks need a good swift slap in the head. TINs and SSNs should be encrypted everywhere it may live.


#4

In our system they are not in plain text. The TINs that I wanted to disrupt came from a client which was in an excel file.

I was able to do what I needed I used this....

CAST(CAST(TIN AS int) AS varchar(15)) as TIN,


#5

According to what a part of your code states (below), they not encrypted.

You also have a client sending you unsecure files with SSNs/TINs in them. Anyone that can intercept them can get to the PII. And, I'm "sure" that you safely archive all of these files by encrypting them, right? And that all your file system backups are encrypted, right?

Just remember that if a data breach occurs and the company is forced to pay big bucks to people who had their identity stolen because of this, they're going to be looking for a scapegoat. According to your actions, you sound like they might choose you as the perfect goat for a fall.

Don't feel insulted... instead, feel very afraid. :wink: