Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

"Rowset column could not be found."

Posted on 2013-05-30
7
Medium Priority
?
374 Views
Last Modified: 2013-06-03
I have a script (SP) about 900 lines long that has been running for 7+ years  I need to delete some rows from a temp table, and I have added the following code:

----
---- delete records for WBC or RBC registrations through OnlinePass
----
--drop table tmp1
-- select ol.order_number,om.meeting,om.REGISTRANT_CLASS
-- into tmp1
-- from Order_Lines ol
-- left outer join Order_Meet om on ol.ORDER_NUMBER = om.ORDER_NUMBER
-- where RIGHT(ol.product_code,7) = 'WBC/REG' and om.registrant_class = 'pass'
-- select * from tmp1

--declare @opc varchar(31)
--declare @onum  float
--declare curdel cursor for
--select order_number, meeting from tmp1
----
---- Open Cursor
----

--      Open curdel
      
----
---- Fetch loop
----
--      fetch next from curdel into @onum, @opc
--      while @@FETCH_STATUS = 0
--      begin
--            set @opc = @opc + '/REG'
--            delete from #dailysalesdetail where ORDER_NUMBER = @onum and PRODUCT_CODE = @opc
--            fetch next from curdel into @onum, @opc      
--      end
--      close curdel
--      deallocate curdel
 
 
 
-- drop table tmp1
-- select ol.order_number,om.meeting,om.REGISTRANT_CLASS
-- into tmp1
-- from Order_Lines ol
-- left outer join Order_Meet om on ol.ORDER_NUMBER = om.ORDER_NUMBER
-- where RIGHT(ol.product_code,7) = 'RBC/REG' and om.registrant_class = 'pass'
-- select * from tmp1


--declare curdel cursor for
--select order_number, meeting from tmp1
----
---- Open Cursor
----

--      Open curdel
      
----
---- Fetch loop
----
--      fetch next from curdel into @onum, @opc
--      while @@FETCH_STATUS = 0
--      begin
--            set @opc = @opc + '/REG'
--            delete from #dailysalesdetail where ORDER_NUMBER = @onum and PRODUCT_CODE = @opc
--            fetch next from curdel into @onum, @opc      
--      end
--      close curdel
--      deallocate curdel

If I run the script in SSMS runs fine.  If I run it in Crystal i get the above error.?????
0
Comment
Question by:Jeff_Kingston
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 41

Expert Comment

by:Sharath
ID: 39209227
What is error that you are getting?
0
 
LVL 16

Assisted Solution

by:DcpKing
DcpKing earned 668 total points
ID: 39209693
When you run it in SSMS what does it return? Two values? Are they named the same as Crystal expects them to be named?
0
 

Author Comment

by:Jeff_Kingston
ID: 39210424
I select three field into table tmp1.
Using a cursor I loop thru the table and delete records from a temp table #dailysalesdetail.

As the title suggests I get "rowset column could not be found".

In SSMS script runs to completion.

in Crystal I get the error.
0
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 
LVL 49

Expert Comment

by:PortletPaul
ID: 39210441
>>in Crystal I get the error.
and the error is?

??If I run it in Crystal i get the above error.?????
there was no error provided ('above' or 'below')

could you please provide the full error message and any associated text?
0
 
LVL 75

Assisted Solution

by:Anthony Perkins
Anthony Perkins earned 1332 total points
ID: 39213121
it looks like you are missing SET NOCOUNT ON at the top of your script, so Crystal is not picking up any result set.
0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 1332 total points
ID: 39213128
If I run the script in SSMS runs fine.  If I run it in Crystal i get the above error.?????
Then you need to take a second look, as you are comparing apples to oranges and preferably using Results to Text (and not Results to Grid).  Notice how there are at least one message like the following prior to the result set you need:
(x row(s) affected)

If that is the case, then that is your problem.
0
 

Author Closing Comment

by:Jeff_Kingston
ID: 39216823
I stumbled across the problem ... during debugging a "drop table" statement was added to the code so I could run a portion of the script several times ....as soon as I commented out that line all is well....  not sure I understand why.  

Thanks for the insight into causes for this error.  I have added them to my tricks of the trade folder for the next time I nap while coding.
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question