troubleshooting Question

help with stored procedure

Avatar of NetDeveloper
NetDeveloperFlag for Italy asked on
Microsoft SQL Server 2005
2 Comments1 Solution280 ViewsLast Modified:
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
ASKER CERTIFIED SOLUTION
Aneesh
Database Consultant
Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros