473,405 Members | 2,334 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

INSERT - EXEC never returns

I am having an issue with linked servers on Windows 2000 running SQL 2005.

I created the following test case to simplify an issue. I created a small procedure that selects the max site_no from a table called site on one server and called it from another. It runs fine.

However when I try to insert it into a table ( # or permanent ) using insert-exec it never comes back.

I ran a profiler and I was not even able to trap the call, so I don't think it is even getting access to the other server.

If I try to insert the data directly for the site table using a direct select over the linked server it works fine.


---- Calling Code -----

drop table #test_red
go
create table #test_red ( site_no int)

insert #test_red
exec LINKEDSERVER.DEVDB.dbo.mm_test

select * from #test_red
go


---Procedure Code -----
drop procedure mm_test
go
create procedure mm_test
as
select max(site_no) from site
go


Any help you canprovide would be great.

Mark
Jun 26 '07 #1
2 1907
satane
4
HI

create table #test_red ( site_no int)
insert #test_red
exec dbo.mm_test

create table
site(sites int)

insert site(sites) values (25)

create procedure mm_test

begin
select max(sites) from site
end
select * from #test_red

this code is working.it may help u.


I am having an issue with linked servers on Windows 2000 running SQL 2005.

I created the following test case to simplify an issue. I created a small procedure that selects the max site_no from a table called site on one server and called it from another. It runs fine.

However when I try to insert it into a table ( # or permanent ) using insert-exec it never comes back.

I ran a profiler and I was not even able to trap the call, so I don't think it is even getting access to the other server.

If I try to insert the data directly for the site table using a direct select over the linked server it works fine.


---- Calling Code -----

drop table #test_red
go
create table #test_red ( site_no int)

insert #test_red
exec LINKEDSERVER.DEVDB.dbo.mm_test

select * from #test_red
go


---Procedure Code -----
drop procedure mm_test
go
create procedure mm_test
as
select max(site_no) from site
go


Any help you canprovide would be great.

Mark
Jun 26 '07 #2
Thanks but the problem is running the procedure accross the linked server.
The code below works because the SP is local.

insert #test_red
exec dbo.mm_test

Any other ideas?
Jun 26 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: news | last post by:
I have no idea if this is a Linux issue or PHP. Looking for clues here. I have a PHP script which I use to upload a CSV spreadsheet into a mySQL database. (The script follows here in a sec.) I...
7
by: Bill Kellaway | last post by:
Hi there - this should be fairly simple for someone. Basically I can't figure out how to pass the parameters from ASP to a Stored Procedure on SQL. Here's my code: I just need to help in...
4
by: Lauren Quantrell | last post by:
I have created the following trigger: CREATE TRIGGER ON OutputTable FOR INSERT AS Declare @filename nvarchar(35) Declare @filecontents nvarchar(2000) Declare @strcmdshell varchar(150)
4
by: teddysnips | last post by:
I am trying to insert a row into a table using a stored procedure and I get the following error if I try this from QA: INSERT failed because the following SET options have incorrect settings:...
1
by: billa1972 | last post by:
Hi, I have a sproc with 5 params that takes about 40 seconds to return. But when I Create a Temp table and do a Insert Into #temp Exec sproc param1, param2, param3, param4, param5 it...
17
by: comp.lang.tcl | last post by:
The TCL command I am using will do a command-line action on a PHP script: set cannotRunPHP I have to do it this way as both the TCL script and the PHP script run as CLI. However, "info.php"...
0
by: Scarab | last post by:
Hi all, When I use following sql to get data in stored procedure, error occurs: insert into #tmp EXECUTE dbo.prc_1 @date1,@date1 Here is the source code, Thanks CREATE TABLE ( NULL , ...
1
by: timothy.alvis | last post by:
It's not so much a problem, as I don't know how to get around this issue. We have applications that rely on the return value of a stored procedure. This stored procedure inserts a record into a...
1
by: masri999 | last post by:
Hello, I want to share my experiences about using insert into exec which may help others . Using SQL Server 2000, SP3 . Two Proceduers - Parent SP caliing a Child SP (nested ) . No...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.