SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 uniqueidentifier incompatible with int
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

marclas
Starting Member

Camaroon
16 Posts

Posted - 05/08/2012 :  07:55:44  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

5152 Posts

Posted - 05/08/2012 :  08:03:00  Show Profile  Reply with Quote
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

Camaroon
16 Posts

Posted - 05/08/2012 :  08:25:09  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000