here's a bit to get you started abz,
-- Script generated on 2/01/09 10:26 AM
-- By: DOMAIN\cognos\Jim
-- Server: ASTON_COGNOS
BEGIN TRANSACTION
DECLARE @JobID BINARY(16)
DECLARE @ReturnCode INT
SELECT @ReturnCode = 0
IF (SELECT COUNT(*) FROM msdb.dbo.syscategories WHERE name = N'DataWarehouseBuild') < 1
EXECUTE msdb.dbo.sp_add_category @name = N'DataWarehouseBuild'
-- Delete the job with the same name (if it exists)
SELECT @JobID = job_id
FROM msdb.dbo.sysjobs
WHERE (name = N'1. Copy Source Data')
IF (@JobID IS NOT NULL)
BEGIN
-- Check if the job is a multi-server job
IF (EXISTS (SELECT *
FROM msdb.dbo.sysjobservers
WHERE (job_id = @JobID) AND (server_id <> 0)))
BEGIN
-- There is, so abort the script
RAISERROR (N'Unable to import job ''1. Copy Source Data'' since there is already a multi-server job with this name.', 16, 1)
GOTO QuitWithRollback
END
ELSE
-- Delete the [local] job
EXECUTE msdb.dbo.sp_delete_job @job_name = N'1. Copy Source Data'
SELECT @JobID = NULL
END
BEGIN
-- Add the job
EXECUTE @ReturnCode = msdb.dbo.sp_add_job @job_id = @JobID OUTPUT , @job_name = N'1. Copy Source Data', @owner_login_name = N'DOMAIN\Administrator', @description = N'No description available.', @category_name = N'DataWarehouseBuild', @enabled = 1, @notify_level_email = 0, @notify_level_page = 0, @notify_level_netsend = 2, @notify_level_eventlog = 2, @delete_level= 0, @notify_netsend_operator_name = N'aston_cognos'
IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback