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 8079741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:12:23+00:00 2026-06-05T16:12:23+00:00

I have [MySp], A stored procedure. So check this out.. when I run this

  • 0

I have [MySp], A stored procedure.

So check this out.. when I run this it works:

 SELECT ID,Name FROM Table

But, When I do this, I get an error on the application side (Adodb)

 Declare @Table TABLE(ID int,Name varchar(10))

 --- Inserts into table variable ---
 INSERT INTO @Table
 SELECT ID,Name FROM Table

 --- Returns data from table variable ---
 SELECT ID,Name FROM @Table

Keep in mind, in SQL Console i get the same results for [MySp], but in the application/adodb code i get errors.

ASP Code:

Set oRS = Server.CreateObject("Adodb.Recordset")
oRS.Open "[MySp]", Conn
If oRS.EOF Then...  <--Gives an error

 ADODB.Recordset error '800a0e78'
 Operation is not allowed when the object is closed. 

Does anyone know why I’m getting this error when I use Table variables in SQL?

  • 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-06-05T16:12:25+00:00Added an answer on June 5, 2026 at 4:12 pm

    Try adding SET NOCOUNT ON at the top of the stored procedure.

    I have a vague recollection that ADO used to get confused by the result counts coming back from inserts/updates/deletes.

    E.g.:

    CREATE PROCEDURE MySP
    AS
    
    SET NOCOUNT ON
    
    Declare @Table TABLE(ID int,Name varchar(10))
    
     --- Inserts into table variable ---
     INSERT INTO @Table
     SELECT ID,Name FROM Table
    
     --- Returns data from table variable ---
     SELECT ID,Name FROM @Table
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to write a Stored Procedure to delete record from a table. I
i have some troubles filling a predefined table with a stored procedure. mytable has
I need to filter a table based on ManufacturerID in a stored procedure BUT
I have a dynamic query which reads like this Alter PROCEDURE dbo.mySP -- Add
I have MS SQL Server stored procedure that returns XML (it uses SELECT with
I have an external stored procedure (SP) in AS400 with IN and OUT prameters.When
I have already created a stored procedure for Select Query and it is working
I have a select stored procedure and I am trying to make it so
I have a stored procedure which is executing a dynamic select query. The query
Have someone tried out DeCAL in Delphi 2009? I'm thinking about upgrading from 2007,

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.