hi i have view that have all the columns selected and have stored procedure that give calculated amount.
how can i get total result combine with all the result with both view and column.,
is it advisable to create cursor!!!
declare @id bigint
DECLARE Employee_Cursor CURSOR FOR
SELECT testid
FROM testview
OPEN Employee_Cursor;
FETCH NEXT FROM Employee_Cursor;
WHILE @@FETCH_STATUS = 0
BEGIN
FETCH next FROM Employee_Cursor
into @id
while @@fetch_status = 0
begin
exec testproc @testid= @id
FETCH next FROM Employee_Cursor
into @servicekey
END
end
CLOSE Employee_Cursor;
DEALLOCATE Employee_Cursor;
how can i get total result combine with all the result with both view and column.,
is it advisable to create cursor!!!
declare @id bigint
DECLARE Employee_Cursor CURSOR FOR
SELECT testid
FROM testview
OPEN Employee_Cursor;
FETCH NEXT FROM Employee_Cursor;
WHILE @@FETCH_STATUS = 0
BEGIN
FETCH next FROM Employee_Cursor
into @id
while @@fetch_status = 0
begin
exec testproc @testid= @id
FETCH next FROM Employee_Cursor
into @servicekey
END
end
CLOSE Employee_Cursor;
DEALLOCATE Employee_Cursor;