1

I have a stored procedure for query some data. I want get this data and put into table or update the table with these data. how can i get this? I have tried many methods and all fail. somebody can help me please??

1 Answer 1

1

You can run the Stored Procedure using OPENQUERY if it doesn't use parameters, or if you can hardcode the parameters, e.g.

update othertable
  set ....
from openquery([SQLSERVER], 'exec ABC') X
join othertable ....

(Replace SQLSERVER with the name of the server/instance.)

Or you can put the data from the proc into a temp table then join to it, e.g.

insert #tmptablename
exec ABC 1,2,3

(where you first create #tmptablename with the exact columns expected from the resultset from proc "ABC")

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.