Solved

"Rowset column could not be found."

Posted on 2013-05-30
7
367 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 167 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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
LVL 48

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 333 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 333 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

751 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