Link to home
Start Free TrialLog in
Avatar of NetDeveloper
NetDeveloperFlag for Italy

asked on

help with stored procedure

Hi, I created a stored procecure with this logic. I woul like to test it in sql analyzer and see the recordset that it should exract. What I have to do? Thanks and regards

------------------------------------------------------------------------------

BEGIN
      SET NOCOUNT ON

DECLARE @Cv_Guid uniqueidentifier

DECLARE Cv_Id_Cursor CURSOR FOR
SELECT  guid
FROM    dbo.MyTable1

-- declare the cursor
OPEN Cv_Id_Cursor
FETCH Cv_Id_Cursor INTO @Cv_Guid

WHILE @@Fetch_Status = 0        

BEGIN
  SELECT * FROM Mytable2 WHERE guid = @Cv_Guid
  and (dataType = '41' and (dataDate >= '2007-05-27' and dataDate < CONVERT(varchar,getdate()+1,112)))

   FETCH Cv_Id_Cursor INTO @Cv_Guid
 END

CLOSE Cv_Id_Cursor
DEALLOCATE Cv_Id_Cursor
END
Avatar of Aneesh
Aneesh
Flag of Canada image

You can run the same code in Query analyser, it will give you the results
ASKER CERTIFIED SOLUTION
Avatar of Aneesh
Aneesh
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial