Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_convertwebtasks

 

sp_convertwebtasks is no longer supported in SQL Server 2008. SQL Server 2005 supports the following three undocumented web task system stored procedures:
- sp_readwebtask
- sp_convertwebtasks
- sp_cleanupwebtask
- sp_dropwebtask

The web task system stored procedures are not enabled upon installation. To enable these stored procedures, you should use the Web Assistant Procedures Option to enable the Web Assistant procedures on this server.
To use the Web Assistant, you must also run the Web.sql script, available in the SQL Server 2005 installation location, in the MSSQL.x\MSSQL\Install folder.

Use Reporting Services instead.




Syntax

--====================================================================================
-- sp_convertwebtasks: Converts 6.5 webtasks to 7.0 format

CREATE PROCEDURE sys.sp_convertwebtasks
AS
BEGIN
    DECLARE	@retval int
    DECLARE	@procname nvarchar(128)
    DECLARE	@thisproc nvarchar(128)
	DECLARE @wpw_65 varbinary(5)
	DECLARE @TotalConverted	int
	DECLARE	@TotalFailed	int

	-- Make sure that it's the SA executing this.
    IF ( NOT ( is_srvrolemember('sysadmin') = 1 ) )
    BEGIN
       RAISERROR( 15003, -1, -1, 'sysadmin' )
       RETURN(1)	
    END

	-- Are there any webtasks to convert?
	IF ((SELECT count(*) FROM msdb..mswebtasks) = 0)
		goto DONE

	SET @TotalConverted = 0
	SET @TotalFailed = 0

	-- Initialize variables
	SET	@thisproc = 'sp_convertwebtasks'
	SET	@retval = 0
	SET	@wpw_65 = 0x00

	-- Loop through all tasks and convert to 7.0 format
	DECLARE webtaskCur cursor FOR
		SELECT procname FROM msdb..mswebtasks
		WHERE substring(wparams,1,2) = @wpw_65		-- version 6.5

	OPEN webtaskCur
	FETCH webtaskCur INTO @procname	

	WHILE (@@fetch_status = 0)
	BEGIN
		EXEC @retval = sys.xp_convertwebtask @procname
		IF (@retval <> 0)
		BEGIN
			
			RAISERROR('%s: Failed to convert webtask from 6.5 to 7.0 format.  You need to use sp_makewebtask to recreate the task',16,1,@thisproc, @procname) WITH LOG
			SET @TotalFailed = @TotalFailed + 1

		END
		ELSE
		BEGIN
			
			-- Increment successfully converted task count
			SET @TotalConverted = @TotalConverted + 1
			
			-- Tag webtasks in sysjobs.  Web Assistant tasks are category 4.		
			UPDATE msdb.dbo.sysjobs
			SET category_id = 4
			WHERE name = @procname

		END

		FETCH webtaskCur INTO @procname
	END

	CLOSE webtaskCur
	DEALLOCATE webtaskCur

	RAISERROR('%s: %d web tasks converted successfully.  %d webtasks failed to convert.',0,1,@thisproc, @TotalConverted,@TotalFailed) WITH LOG

-- Done with conversion

DONE:
    RETURN @retval

END

 
Last revision
News

  Query a named instance
Sybase+ASE+silent+install
SQL 2008 R2
Deprecated procedures in SQL2008
Reporting Services item-level role definitions
Create all your missing indexes
Converting datetime field
Start MSSQL Server Profiler at time
Replicating MSSQL Server views
Exploring Microsoft Sharepoint
The OLE DB provider "SQLNCLI10" for linked server indicates.
Mobile solar charger
Oracle to SQL Server replication
Cannot insert the value NULL into column
Undocumented Microsoft SQL Server 2008
VMware
Zoekmachine optimalisatie
SQL Servers hidden objects
FckEditor
Flash in Ajax
De hype die AJAX heet
Barcode scannen
MySQL; Gratis, makkelijk en snel!
PHP
sIFR; de combinatie tussen HTML en Flash