Calling a stored procedure from a T-Sql Statement

Last Post 03 Jul 2008 01:01 PM by werice. 0 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
werice
New Member
New Member

--
03 Jul 2008 01:01 PM
I am trying to call a stored procedure from a T-SQL statement:

Select do.SiteNo, do.ShipNo,s.PIName,s.Institution, s.SCName,s.SCTelephone,s.SCFax,s.FaxOrEmail, s.SCEmail, s.PIFax,
Case s.FaxOrEmail When 'F' Then isnull(s.SCName,'') + '[Fax: ' + isNull(s.SCFax,'') + ']; ' + isnull(s.PIName,'') + '[Fax: ' + isnull(s.PIFax,'') + ']; ' + @AlertDistList
When 'E' Then isnull(s.SCEmail,'') + '; ' + isnull(s.PIName,'') + '[Fax: ' + isnull(s.PIFax,'') + ']; ' + @AlertDistList
End,do.ICTIDateOrdered,do.DateExpected,doq.Quantity,(PR_GET_VIAL_STRING do.ShipNo)
from DrugOrders do
inner join Site s
on s.SiteNo=do.SiteNo
inner join DrugOrderQuantity doq
on do.ShipNo = doq.ShipNo
Where ICTIDateReceived is null and DateAdd(d,@ShipAlertDays,convert(datetime,convert(varchar(11),DateExpected))) < getdate()


The stored procedure is PR_GET_VIAL_STRING and ShipNo is the parameter.

I get the error : Line 25: Incorrect syntax near 'do'.

Is there a way to do this ?

Thanks ahead of time: OZMO


Acceptable Use Policy
---