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.
| Author |
Topic |
|
Passero
Starting Member
12 Posts |
Posted - 2008-01-23 : 09:49:34
|
| I have a SP with an output parameter. I cannot rewrite the SP to a function because i use updates and inserts. I also need that SP for a query. Normally i would write:exec mySP @var, @result output;now i want @result in a query likeselect mySP(col1,... output) from table; Is this possible? I need this in a batch scriptIn fact, i need this in an update or insert statement. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-01-23 : 11:08:22
|
| Try this & see if it works :-SELECT m.*FROM Table tCROSS APPLY mySP(t.Col1,..OUTPUT) m |
 |
|
|
Passero
Starting Member
12 Posts |
Posted - 2008-01-24 : 03:07:11
|
| THanks for the answer...I've tried this as a test:declare @t table(n int);insert into @t values (1);insert into @t values (2);insert into @t values (3);declare @r intselect n from @t tcross apply dbo.bahu_number t.n,5,1,@r outputbut i get an error: Incorrect syntax near '.'And it point to my last line. |
 |
|
|
|
|
|