OPENROWSET |
| sundar k replied to bretto kumar A at 06-Jul-08 01:39 |
what you can do is - you can execute a stored procedure in a query using OPENROWSET option and can change your query as,
select top 3 newsid from staff s, OPENROWSET('SQLOLEDB','Server=(local);TRUSTED_CONNECTION=YES;','set fmtonly off exec master.dbo.spu_SdOtherNews') AS a where s.id <> a.id order s.id desc
Assuming spu_SdOtherNews is in Master databawse and it returns the list of ids. |
|