Hi all. I have this stored procedure which executes a lot of sql queries and returns the results. How do i go about returning only the results from the queries that returns rows?
BEGIN
DECLARE @Query varchar(4000)
DECLARE cur CURSOR FOR SELECT SQLSyntax FROM tblChecks
OPEN cur
FETCH NEXT FROM cur INTO @Query
WHILE @@FETCH_STATUS = 0 BEGIN
EXEC (@Query)
FETCH NEXT FROM cur INTO @Query
END
CLOSE cur
DEALLOCATE cur
END
Abhilash J APosted Jun 22, 2017, 12:45 PM
Abhilash J APosted Jun 22, 2017, 11:39 PM
ThomasPosted Jun 22, 2017, 12:42 PM
Abhilash J APosted Jun 22, 2017, 12:42 PM
Abhilash J APosted Jun 22, 2017, 12:39 PM
Rajkiran SwainPosted Jun 22, 2017, 12:16 PM
Nilesh ShahPosted Jun 22, 2017, 11:16 AM