HTML files from tables

  • I need to extract N number of HTML files out of the table as username.htm where N equals distinct number of values of usernames in the table 'myTable'.I cant seem to run this code,but the general idea of the code is pasted below.I understand sp_makewebtask is deprecated but I would still like to use it.Can someone help me fix this.

    Thanks

    DECLARE @RowCount INT

    SET @RowCount = (SELECT COUNT(UserID) FROM @myTable)

    DECLARE @I INT

    SET @I = 1

    WHILE (@I <= @RowCount)

    BEGIN

    DECLARE @ID VARCHAR(50),@Username VARCHAR(50)

    SELECT @ID = ID FROM @myTable

    EXEC sp_makewebtask @outputfile = C:\@Username.htm,@query='select * from myTable where ID=@ID'

    SET @I = @I + 1

    END

Viewing post 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply