Solved

"Rowset column could not be found."

Posted on 2013-05-30
7
362 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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
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…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

777 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