Hello,
I am new in the world of SQL Server and I have a question that nobody yet could answer to me (sorry for my english, I am a Frenchy ;-) )
I develop a sp that generate a table of value from diferent tables, but, sometimes I make 3 times the same ask and it takes a while to get the result.
For example I would like to have only one line for those 2 :
Set @Case9 = (Select sum(Montant_TTC) FROM Factures_Rect
WHERE Ref_Mission=@IDMission)
Set @Case10 = (Select sum(Montant_TVA) FROM Factures_Rect
WHERE Ref_Mission=@IDMission)
As you can see I scan 2 times the table for the nearly same quest
Thank you for your help
I am new in the world of SQL Server and I have a question that nobody yet could answer to me (sorry for my english, I am a Frenchy ;-) )
I develop a sp that generate a table of value from diferent tables, but, sometimes I make 3 times the same ask and it takes a while to get the result.
For example I would like to have only one line for those 2 :
Set @Case9 = (Select sum(Montant_TTC) FROM Factures_Rect
WHERE Ref_Mission=@IDMission)
Set @Case10 = (Select sum(Montant_TVA) FROM Factures_Rect
WHERE Ref_Mission=@IDMission)
As you can see I scan 2 times the table for the nearly same quest
Thank you for your help