DECLARE @MYVAR NVARCHAR(100)
Declare @date datetime
Declare @Host varchar(100)
DECLARE MYTESTCURSOR CURSOR
DYNAMIC
FOR
SELECT Your_Col,HOST_NAME() FROM Your_tab
OPEN MYTESTCURSOR
FETCH LAST FROM MYTESTCURSOR INTO @MYVAR,@Host
CLOSE MYTESTCURSOR
DEALLOCATE MYTESTCURSOR
SELECT @MYVAR,@Host
Declare @date datetime
Declare @Host varchar(100)
DECLARE MYTESTCURSOR CURSOR
DYNAMIC
FOR
SELECT Your_Col,HOST_NAME() FROM Your_tab
OPEN MYTESTCURSOR
FETCH LAST FROM MYTESTCURSOR INTO @MYVAR,@Host
CLOSE MYTESTCURSOR
DEALLOCATE MYTESTCURSOR
SELECT @MYVAR,@Host
No comments:
Post a Comment