October 15, 2003 at 2:33 pm
When I drop a table,create another table and fill it with data, the resultset showed in a view is the table´s name that I dropped.
How can I choose the another resultset.
Thanks
Ricardo Frasson
October 15, 2003 at 7:50 pm
How are you viewing the resultsets?
If you're using ADO, you'll need to use the NextRecordset method.
Hope this helps
Phill Carter
--------------------
Colt 45 - the original point and click interface
--------------------
Colt 45 - the original point and click interface
October 16, 2003 at 4:58 am
You shouldn't end up with more than one resultset of actual data depedning on how you are doing this but you may be getting the messages back. Do you have actual data from the drop?
October 16, 2003 at 7:12 am
I´m Trying to open the resultset in a view, and then show it in Asp pages.
CREATE PROCEDURE [DBO].[test10] AS
SELECT name from sysobjects where name = 'Cadconsumo'
IF @@ROWCOUNT > 0
BEGIN
DROP TABLE Cadconsumo
END
SELECT MES, ANO, SUBSTRING(LINHA, 1, 4) AS LINHA, SUM(KM) AS KM, SUM(COMB) AS LITROS, TMOTOR, SUM(KM) / SUM(COMB) AS Consumo
INTO CACONSUMO
FROM intranet.dbo.RDB
GROUP BY MES, ANO, SUBSTRING(LINHA, 1, 4), TMOTOR
HAVING (SUM(KM) > 0) AND (SUM(COMB) > 0)
ORDER BY SUBSTRING(LINHA, 1, 4), MES, ANO, TMOTOR
Select * from CADCONSUMO
When I call this from a view, the resultset showed is:
--------------------
Name
CADCONSUMO
When I call From Query Analiser, the resultset shows 2 recordsets.
October 16, 2003 at 8:33 am
There are two things you might try... First, instead of
SELECT name...
IF @@ROWCOUNT
Try
IF EXISTS ( SELECT * FROM sysobjects WHERE Name = 'Cadconsumo' AND Type = 'U' )
DROP TABLE Cadconsumo
Second, I would probably put
SET NOCOUNT ON
at the beginning with
SET NOCOUNT OFF just before
SELECT * FROM Cadconsumo
(Just for fun)
Guarddata-
October 16, 2003 at 9:07 am
Hi Folks,
It´s working very well !!
Thank you for your help
Regards
Ricardo Frasson
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply