Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 985591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:11:18+00:00 2026-05-16T05:11:18+00:00

I wish to do the following: select * into tmptbl from sometable EXCEPT ‘sometable’

  • 0

I wish to do the following:

select * into tmptbl from sometable

EXCEPT ‘sometable’ is a stored procedure that returns a result set AND editing the stored procedure to suit my goal is not an option. ALSO i may or may not know the columns and types of what the procedure returns.

Basically i am looking for a proper way of doing this:

select * into tmptbl from exec someSP

Is this even possible, if so, how?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T05:11:19+00:00Added an answer on May 16, 2026 at 5:11 am

    yes it is possible with a loopback query like this

    SELECT * INTO #tmptbl 
        FROM OPENROWSET ('SQLOLEDB','Server=(local);TRUSTED_CONNECTION=YES;'
       ,'set fmtonly off exec DatabaseName.dbo.someSP')
    

    More example here: Store The Output Of A Stored Procedure In A Table Without Creating A Table

    Be aware that this has to be turned on first, see here: How to enable xp_cmdshell and Ad Hoc Distributed Queries on SQL Server 2005

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table that I wish to select a subset of columns from
I'm looking to convert the following SQL into Linq2SQL. select isnull(max(Id),0) from tbl Even
I have the following Mysql select that returns all the duplicate email addresses in
I wish to make sure that my data has a constraint the following check
How can I select just some rows in the following table so that they
I currently have the following select statement, but I wish to move to full
Currently I have the following command: SELECT * FROM `clients` WHERE `ID`=(SELECT `clientID` FROM
I have a table that I wish to find the first non-null value from
I have the following query in sql: SELECT a1 FROM dbo.myProductNames WHERE keycode =
I have the following code that loads element from a remote page (under same

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.