|
Home > Archive > MS SQL Server > December 2006 > Callind Stored Proc from Stored Proc
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Callind Stored Proc from Stored Proc
|
|
|
| I am trying to call a stored proc from within a stored proc as below, but it
throws a syntax error.
SELECT COUNT(*) FROM (EXEC spName)
I have no access to "spName" to make any amends, currnetly it returns a
large recordset of customers.
Anyone any ideas how to do this?
| |
| Uri Dimant 2006-12-14, 5:25 am |
| Billy
INSERT INTO #tmp EXEC spName ---Make sure that number of columns in the
#tmp should be match to the output from the SP
SELECT COUNT(*) FROM #tmp
"Billy" <Billy@discussions.microsoft.com> wrote in message
news:26DC8B64-FF85-4BE0-8913- B84A021C2D40@microso
ft.com...
>I am trying to call a stored proc from within a stored proc as below, but
>it
> throws a syntax error.
>
> SELECT COUNT(*) FROM (EXEC spName)
>
> I have no access to "spName" to make any amends, currnetly it returns a
> large recordset of customers.
>
> Anyone any ideas how to do this?
>
>
| |
| Paul Ibison 2006-12-14, 5:25 am |
| Try using "select @@rowcount" immediately after executing the proc.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .
|
|
|
|
|