Solved

"Rowset column could not be found."

Posted on 2013-05-30
7
361 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
7 Comments
 
LVL 40

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
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how the fundamental information of how to create a table.

867 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now