Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 uniqueidentifier incompatible with int

Author  Topic 

marclas
Starting Member

16 Posts

Posted - 2012-05-08 : 07:55:44
i wrote this request but I got an error and i can not solve it
thankks for your help

-- Insert statements for procedure here
SELECT dbo.CSR_DOSSIER.DOS_NOM +' '+ ISNULL ( dbo .CSR_DOSSIER.DOS_PRENOM, ' ') as Nom
FROM dbo.CSR_DOSSIER ,dbo.CSR_STATUT
WHERE CSR_DOSSIER.DOS_ID = CSR_STATUT.STA_ID
AND dbo .CSR_DOSSIER.DOS_ID =(SELECT dbo.CSR_DOSSIER.DOS_ID
FROM dbo.CSR_DOSSIER WHERE DOS_NODE =@node )

AND CSR_STATUT.STA_ID=6 OR CSR_STATUT.STA_ID=7


Marclas

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-05-08 : 08:03:00
Somewhere you are trying to compare a column whose data type is UNIQUEIDENTIFER to a value/column that is an integer. Run this query to see which column(s) are of type uniqueidentifer. Then, in your query examine if you are comparing those columns against any integers - for example, if CSR_STATUT.STA_ID is of type uniqueidentifer, you cannot do something like "CSR_STATUT.STA_ID=7"
SELECT TABLE_NAME,COLUMN_NAME 
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME IN ('CSR_DOSSIER','CSR_STATUT')
AND DATA_TYPE = 'uniqueidentifier'
Go to Top of Page

marclas
Starting Member

16 Posts

Posted - 2012-05-08 : 08:25:09
Hi,

I found the error,
I have miswrite an instruction so i have corrected it

so instead of WHERE CSR_DOSSIER.DOS_ID = CSR_STATUT.sta_id

i have corrected to WHERE CSR_DOSSIER.DOS_ID = CSR_STATUT.DOS_ID

and is OK

merci

Marclas
Go to Top of Page
   

- Advertisement -