Solved

DTS- Invalid Pointer error

Posted on 2004-04-08
3
705 Views
Last Modified: 2013-11-30
Hi,

I'm using MS SQL Server 7

I've created a simple stored procedure which works fine from the query analyzer.

However when I run it from with a DTS package, I get the message:

INVALID POINTER.   I've tried using the USE statement which doesn't work either.

The stored procedure is as follows:

declare @rcnt int
declare @total int
declare @totaled char(30)
declare @player char(30)
declare @player2 real
declare @msgline char(10)
declare  fincursor scroll cursor for (select inctrn,insize from rminvmfl where inctrn = "01323")
      open fincursor
      print @@cursor_rows
      set @rcnt = 0
      set @total  = 0
      fetch first from   fincursor into @player,@player2
      while (@rcnt < @@cursor_rows)
      begin
            if(@player2 = 1.00)
                  set  @player2 = @player2 * 75.29
            set  @total = (@total + @player2)
            set @totaled = @total
            set @rcnt = @rcnt + 1
            set @msgline = @player2
            print @player +  @msgline + @totaled
            fetch next from   fincursor into @player,@player2
      end
      print "total = "
      set @msgline = @total
      print @msgline
deallocate fincursor


Any help would be appreciated. Thanks

Phil31
0
Comment
Question by:phil31
  • 2
3 Comments
 
LVL 3

Assisted Solution

by:jayrod
jayrod earned 150 total points
ID: 10783973
don't forget to close the cursor before deallocating
0
 
LVL 3

Expert Comment

by:jayrod
ID: 10783989
just curious but why are you using a scroll type of cursor? is it neccessary?  Other than that I don't see anything wrong with the cursor..

usually if there is a problem with DTS running a package while you can run it w/o error in Anylyzer it's cause by a permission problem or a location problem. I.e. DTS doesn't have access to a resource that's needed.

Explain the DTS more perhaps
0
 
LVL 34

Accepted Solution

by:
arbert earned 250 total points
ID: 10795979
"usually if there is a problem with DTS running a package while you can run it w/o error in Anylyzer it's cause by a permission problem or a location problem."

If it's a scheduled package or run from the server tools instead of the client tools....

Do you have the latest SQL7.0 Service Pack?  Dts in 7.0 was very very buggy....
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

863 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

26 Experts available now in Live!

Get 1:1 Help Now