Monday, March 26, 2012

Linked Server Problem

Hi,
I have view V-A in database DB-A on server S-A. This View uses a recursive
function that stops when the recursion level is 31.
In the SQL Query analyzer, I can run "select * from V-A" and get back the
results.
I have aserver S-B, in which I have set up link to S-A and DB-A.
When I run "Select * From S-A.DB-A.dbo.V-A" on Server S-B, I get an error
Server: Msg 217, LEvel 16, State 1, Line 1
Maximum Stored PRocedure, function, trigger, or view nesting level exceeded
(limit 32)
KramsHi,
I am posting to inform that the issue has been resolved.
The recursive function was being called in the view with seed level of 2(It
starts at level as 2 and recurses until the level is 31). This seed level
works fine when called directly from the local server(S-A). Adjusting the
Seed leve lto 3, instead of 2, made the call from the remote server (S-B)
which had a linked reference to S-A work.
It appears that the linking of a server somehow adds a level to the stack.
Wonder if someone from MS can explain what is going on.
Krams
"Krams" <kramz@.hotmail.com> wrote in message
news:uNUwXoZQEHA.3660@.tk2msftngp13.phx.gbl...
> Hi,
> I have view V-A in database DB-A on server S-A. This View uses a recursive
> function that stops when the recursion level is 31.
> In the SQL Query analyzer, I can run "select * from V-A" and get back the
> results.
> I have aserver S-B, in which I have set up link to S-A and DB-A.
> When I run "Select * From S-A.DB-A.dbo.V-A" on Server S-B, I get an error
> Server: Msg 217, LEvel 16, State 1, Line 1
> Maximum Stored PRocedure, function, trigger, or view nesting level
exceeded
> (limit 32)
> Krams
>
>

No comments:

Post a Comment