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 |
|
nicky_river
Yak Posting Veteran
55 Posts |
Posted - 2010-07-30 : 08:11:43
|
| Hi Everyone,Can a stored procedure be called inside a function ? If yes, then how ? and if no, then why no ?Can a stored procedure be called inside a view ? If yes, then how ? and if no, then why no ? |
|
|
Kristen
Test
22859 Posts |
Posted - 2010-07-30 : 08:16:43
|
| No, not really, on both counts. There are bodges to work around this by using OPENROWSET or somesuch to get an external connection back to the server/database, but it is not recommended. |
 |
|
|
nicky_river
Yak Posting Veteran
55 Posts |
Posted - 2010-07-30 : 08:58:47
|
| Hi Kristen,Could you tell me why using OPENROWSET is not recommended ? |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2010-07-30 : 09:15:53
|
| Cumbersome, probably inefficient, but mostly because it makes the function nondeterministic.Best to solve your problem a different way. |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|
|