RE: An insert exec statement cannot be nested. Pls HELP.
From: BlueDolphin (BlueDolphin_at_discussions.microsoft.com)
Date: 11/04/04
- Next message: Armando Méndez: "MAC Address"
- Previous message: hon123456: "The difference between Cross Join and Left outer join"
- In reply to: David Portas: "RE: An insert exec statement cannot be nested. Pls HELP."
- Next in thread: BlueDolphin: "RE: An insert exec statement cannot be nested. Pls HELP."
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 3 Nov 2004 18:34:03 -0800
Hello David,
Thanks for the useful information.
But one more question here:
Before we can use SELECT * FROM OPENQUERY(LOCALSERVER, 'EXEC SP....'),
we need to run the following 3 lines:
SET ANSI_NULLS ON
SET ANSI_WARNINGS ON
EXEC sp_addlinkedserver @server='LOCALSERVER', @srvproduct='',
@provider='SQLOLEDB', @datasrc=@@servername
Do we put these 3 lines in the stored proc that is running the SELECT
OPENQUERY statement? Or do we just execute the 3 lines manually in query
analyser?
Please advise, cos' it seems like sp_addlinkedserver can't be called twice
and would give error of server already exists if executed a second time in
the stored proc.
Also, after the SELECT OPENQUERY statement, do we have to drop the linked
server LOCALSERVER?
Would it be possible to show an example of handling these 3 activation lines
on how to do this in the stored proc that is trying to call the 2nd stored
proc?
Thanks much for your valuable advise.
"David Portas" wrote:
> http://www.sommarskog.se/share_data.html
>
> --
> David Portas
> SQL Server MVP
> --
>
- Next message: Armando Méndez: "MAC Address"
- Previous message: hon123456: "The difference between Cross Join and Left outer join"
- In reply to: David Portas: "RE: An insert exec statement cannot be nested. Pls HELP."
- Next in thread: BlueDolphin: "RE: An insert exec statement cannot be nested. Pls HELP."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|