Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
SET NOCOUNT ON
DECLARE @iReturnCode int,
@iNextRowId int,
@iCurrentRowId int,
@iLoopControl int,
@Msg varchar(100),
@DoctorID int,
@PreviousDoctorID int,
@Type int
SELECT @iLoopControl = 1
SELECT @iNextRowId = MIN(DoctorID)
FROM DrContacts
SELECT @iCurrentRowId = Doctorid,
@Type = Type
FROM DrContacts
WHERE DoctorID = @iNextRowId
WHILE @iLoopControl = 1
BEGIN
-- processing starts here
-- processing end here
print @icurrentrowid
SELECT @iNextRowId = NULL
SELECT @iNextRowId = MIN(DoctorID)
FROM DrContacts
WHERE Doctorid > @iCurrentRowId
IF ISNULL(@iNextRowId,0) = 0
BEGIN
BREAK
END
SELECT @iCurrentRowId = doctorID
FROM DrContacts
WHERE DoctorID = @iNextRowId
END
RETURN
DECLARE Update_Cursor CURSOR
dynamic scroll_locks
FOR select adduser from reportstable
OPEN Update_Cursor
declare @AddUser as int
declare @UpdateValue as int
set @updateValue = 0
FETCH NEXT FROM Update_Cursor INTO @AddUser
WHILE @@FETCH_STATUS = 0
BEGIN
set @updateValue = @updateValue + 1
update ReportsTable set adduser = @UpdateValue where current of Update_cursor
FETCH NEXT FROM Update_Cursor INTO @Adduser
END
Close Update_Cursor
Deallocate Update_Cursor