‘New’ option; everything needs to be lined up and padded properly. It looks like a blahhdy mess right now. You’re foired.
Alan Sugar's taken over my job for the day
‘New’ option; everything needs to be lined up and padded properly. It looks like a blahhdy mess right now. You’re foired.
the Well Planning and Cost Est. reports are designed to display the Rig Name/No. (one or the other depending on whether a name or number has been assigned to the rig, pulled through from the Contractors tab as shown below)
There is no field in the Well Planning and Cost Est reports for Contractor Name, unlike the Daily Ops reports which are designed to display the Contractor Name but not the Rig Name/No.
ALTER PROCEDURE [dbo].[sp_dbutil_CopyWACompProcdure] @compid varchar(20), @facid varchar(20), @compTo varchar(20), @facTo varchar(20), @contcodes varchar(max), @attach int
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
DECLARE @sepPos int
DECLARE @val varchar(1000)
BEGIN TRY
BEGIN TRANSACTION
WHILE PATINDEX('%¬%', @contcodes) <> 0
BEGIN
SET @sepPos = PATINDEX('%¬%', @contcodes)
SET @val = LEFT(@contcodes, @sepPos - 1)
--ADD IN NORMAL PROCESSING SQL HERE @val = the current contcode
--Sub Area Variables
DECLARE @SAsubcont varchar(20)
DECLARE @subAreasCursor CURSOR
DECLARE @sitename varChar(30)
DECLARE @manager varChar(30)
DECLARE @telephone varChar(15)
DECLARE @fax varChar(15)
DECLARE @email varchar(max)
DECLARE @comment varchar(max)
DECLARE @cdate smalldatetime
DECLARE @l_update smalldatetime
DECLARE @edate smalldatetime
--Cursor for all of the sub areas
SET @subAreasCursor = CURSOR FAST_FORWARD FOR
SELECT SUBCONT, SITENAME, MANAGER, TELEPHONE, FAX, EMAIL, COMMENT, CDATE, L_UPDATE, EDATE FROM SUBCONTR WHERE [COMPID] = @compid AND [FACID] = @facid AND [CONTCODE] = @val
OPEN @subAreasCursor
FETCH NEXT FROM @subAreasCursor INTO @SAsubcont, @sitename, @manager, @telephone, @fax, @email, @comment, @cdate, @l_update, @edate
--While there is a sub area
WHILE (@@FETCH_STATUS = 0)
BEGIN
--Sub Assessment Variables
DECLARE @subAssessmentsCursor CURSOR
DECLARE @subcont varchar(20)
DECLARE @mtrlcode int
DECLARE @SubAssesseDate smalldatetime
--Cursor for all the sub assessments
SET @subAssessmentsCursor = CURSOR FAST_FORWARD FOR
SELECT SUBCONT, MTRLCODE, EDATE FROM SUBSCHED WHERE COMPID = @compid AND FACID = @facid AND CONTCODE = @val AND SUBCONT = @SAsubcont
OPEN @subAssessmentsCursor
FETCH NEXT FROM @subAssessmentsCursor INTO @subcont, @mtrlcode, @SubAssesseDate
--While there is a sub assessment
WHILE (@@FETCH_STATUS = 0)
BEGIN
--Sub Activity Variables
DECLARE @subActCursor CURSOR
DECLARE @actNum int
--Cursor for sub assessments activities
SET @subActCursor = CURSOR FAST_FORWARD FOR
SELECT ACTNO FROM SUBSELAC WHERE COMPID = @compid AND FACID = @facid AND CONTCODE = @val AND SUBCONT = @SAsubcont AND MTRLCODE = @mtrlcode
OPEN @subActCursor
FETCH NEXT FROM @subActCursor INTO @actNum
WHILE (@@FETCH_STATUS = 0)
BEGIN
--Insert new sub activity
INSERT INTO SUBSELAC
VALUES (@compTo, @facTo, @val, @subcont, @mtrlcode, @actNum)
FETCH NEXT FROM @subActCursor INTO @actNum
END
--Insert new sub assessment
INSERT INTO SUBSCHED
VALUES (@compTo, @facTo, @val, @subcont, @mtrlcode, @SubAssesseDate)
--Get next assessment
FETCH NEXT FROM @subAssessmentsCursor INTO @subcont, @mtrlcode, @SubAssesseDate
END
CLOSE @subAssessmentsCursor
DEALLOCATE @subAssessmentsCursor
--Insert new sub area
INSERT INTO SUBCONTR
VALUES (@compTo, @facTo, @val, @SAsubcont, @sitename, @manager, @telephone ,@fax, @email, @comment, @cdate, @l_update, @edate)
--Get next sub area
FETCH NEXT FROM @subAreasCursor INTO @SAsubcont, @sitename, @manager, @telephone, @fax, @email, @comment, @cdate, @l_update, @edate
END
CLOSE @subAreasCursor
DEALLOCATE @subAreasCursor
--Work Area Variables
DECLARE @WAsitename varChar(30)
DECLARE @WAmanager varChar(30)
DECLARE @WAloaction varChar(30)
DECLARE @WAaddress1 varchar(30)
DECLARE @WAaddress2 varchar(30)
DECLARE @WAaddress3 varchar(30)
DECLARE @WApostcode varchar(10)
DECLARE @WAtelephone varChar(15)
DECLARE @WAfax varChar(15)
DECLARE @WAemail varchar(max)
DECLARE @WAcomment varchar(max)
DECLARE @WAcdate smalldatetime
DECLARE @WAl_update smalldatetime
DECLARE @WAedate smalldatetime
--Get work area data
SELECT @WAsitename = SITENAME, @WAloaction = LOCATION, @WAaddress1 = ADDRESS1, @WAaddress2 = ADDRESS2, @WAaddress3 = ADDRESS3, @WApostcode = POSTCODE, @WAmanager = MANAGER, @WAtelephone = TELEPHONE, @WAfax = FAX, @WAcomment = COMMENT, @WAcdate = CDATE, @WAl_update = L_UPDATE, @WAedate = EDATE
FROM CONTRACT
WHERE COMPID = @compid AND FACID = @facid AND CONTCODE = @val
--Insert new work area
INSERT INTO CONTRACT
VALUES (@compTo, @facTo, @val, @WAmanager, @WAsitename, @WAloaction, @WAaddress1, @WAaddress2, @WAaddress3, @WApostcode, @WAtelephone, @WAfax, @WAcdate, @WAcomment, @WAl_update, @WAedate)
--Assessment Variables
DECLARE @AssessmentsCursor CURSOR
DECLARE @AssessMtrlcode int
DECLARE @AssessEdate smalldatetime
--Cursor for all of the work area assessments
SET @AssessmentsCursor = CURSOR FAST_FORWARD FOR
SELECT MTRLCODE, EDATE FROM SCHEDULE WHERE COMPID = @compid AND FACID = @facid AND CONTCODE = @val
OPEN @AssessmentsCursor
FETCH NEXT FROM @AssessmentsCursor INTO @AssessMtrlcode, @AssessEdate
--While there is an assessment
WHILE (@@FETCH_STATUS = 0)
BEGIN
--Activity Variables
DECLARE @ActCursor CURSOR
DECLARE @Num int
--Cursor for assessments activities
SET @ActCursor = CURSOR FAST_FORWARD FOR
SELECT ACTNO FROM SELACT WHERE COMPID = @compid AND FACID = @facid AND CONTCODE = @val AND MTRLCODE = @AssessMtrlcode
OPEN @ActCursor
FETCH NEXT FROM @ActCursor INTO @Num
WHILE (@@FETCH_STATUS = 0)
BEGIN
--Insert new activity
INSERT INTO SELACT
VALUES (@compTo, @facTo, @val, @mtrlcode, @Num)
FETCH NEXT FROM @ActCursor INTO @Num
END
--Insert New Assessment
INSERT INTO SCHEDULE
VALUES (@compTo, @facTo, @val, @AssessMtrlcode, @AssessEdate)
--Get next Assessment
FETCH NEXT FROM @AssessmentsCursor INTO @AssessMtrlcode, @AssessEdate
END
CLOSE @AssessmentsCursor
DEALLOCATE @AssessmentsCursor
--Attachments
IF @attach = 1
BEGIN
--Sub Area Attachment Variables
DECLARE @attachSubAreaCursor CURSOR
DECLARE @attachMtrlcode int
DECLARE @attachFilename varchar(1000)
DECLARE @attachAtype varchar(2)
DECLARE @attachSubcont varchar(20)
--Cursor for sub area attachments
SET @attachSubAreaCursor = CURSOR FAST_FORWARD FOR
SELECT MTRLCODE, FILENAME, ATYPE, SUBCONTCODE FROM ATTACH WHERE COMPID = @compid AND FACID = @facid AND CONTCODE = @val
OPEN @attachSubAreaCursor
FETCH NEXT FROM @attachSubAreaCursor INTO @attachMtrlcode, @attachFilename, @attachAtype, @attachSubcont
--while there is a sub area attachment
WHILE (@@FETCH_STATUS = 0)
BEGIN
--Insert new attachment
INSERT INTO ATTACH
VALUES (@compTo, @facTo, @attachMtrlcode, @attachFilename, @attachAtype, @val, @attachSubcont)
FETCH NEXT FROM @attachSubAreaCursor INTO @attachMtrlcode, @attachFilename, @attachAtype, @attachSubcont
END
CLOSE @attachSubAreaCursor
DEALLOCATE @attachSubAreaCursor
END
---------------------------------------------------------------
SET @contcodes = STUFF(@contcodes, 1, @sepPos, '')
END
--SELECT 1/0
SELECT 0 AS Result
COMMIT
END TRY
BEGIN CATCH
SELECT 1 AS Result
ROLLBACK
END CATCH
END
I am level 26 in the video. The skill that knocks them into the air is "Aerial Lockdown" and is obtained at lvl 22, the skill that knocks them down is "Forced Landing" which you get at lvl 25.