Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Puntero no valido - Cursor not Valid error DTS

Author  Topic 

sqlzepher
Starting Member

5 Posts

Posted - 2011-03-18 : 06:39:33
Hello,

I am trying to set up a DTS Export on SQL 2000 that will export a query but I get a "Puntero no es valido" or "Curson not Valid" error.

The query code works fine when I run it on it own and provides the results in the table.

It only gives the error when I run the same query in the DTS process.

Here is my query ...

delete ConsumoClientes3

Insert Into ConsumoClientes3
Select
Cliente as AccountNumber,
Convert (varchar(10),Fecha,103) AS HistoricalDate,
Sum(Segundos)/60 As Minutes,
CONVERT(varchar(100), CAST(SUM(Total) AS decimal(38,4))) as Charges,
CONVERT(varchar(100), CAST(Sum(Coste) AS decimal(38,4))) as Cost,
CAST (Cliente as varchar) + Convert (varchar(10),Fecha,112) AS AutoID

From
Historico
Where
Fecha between getdate()-4 AND getdate()

Group By
Cliente,Convert (varchar(10),Fecha,103),Convert (varchar(10),Fecha,112),Cast (Cliente as varchar) + Convert (varchar(10),Fecha,112)
Order By
Cliente


delete ConsumoClientes3Export

Insert Into ConsumoClientes3Export
SELECT ConsumoClientes3.AccountNumber as AccountNumber,
ConsumoClientes3.HistoricalDate AS Historical_Date,
ConsumoClientes3.Minutes As Minutes,
ConsumoClientes3.Charges as Charges,
ConsumoClientes3.Cost as Cost,
ConsumoClientes3.AutoID AS AutoID,
ClientesSFID.AccountSFID AS Account
FROM ClientesSFID INNER JOIN ConsumoClientes3 ON ClientesSFID.AccountNumber = ConsumoClientes3.AccountNumber
WHERE HistoricalDate between getdate()-5 and getdate()
ORDER BY AutoID ASC;

select * from ConsumoClientes3Export


Any help is greatly appreciated.

thanks

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-03-18 : 09:14:53
When running the query outside DTS in a query window and it works then please have a look for warning messages regarding NULL values.
If there are warning messages regarding NULL values then correct your query and the problem in DTS should be gone.
See here: http://geekswithblogs.net/baskibv/archive/2008/03/23/120720.aspx


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-03-18 : 09:18:14
Another idea:
add a

SET NOCOUNT ON

as the first line


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

sqlzepher
Starting Member

5 Posts

Posted - 2011-03-20 : 15:14:48
Hello Webfred,

Thank you for the reply. I am rathrer new to SQL and I am not familiar with NULL VALUES. I know what they are but I don´t know how code for them.

When I run the SQL Server 2000 Query Analyzer it just returns that results and does not mention any warning messages / errors with null values.

I have set the first line to SET NOCOUNT ON and it appears to be working.

Thanks for you help.

Go to Top of Page
   

- Advertisement -