Follow the below MS SQL syntax for create new CursorDECLARE emFIRST CURSOR FORSELECT EMP_NUMBER FROM HS_HR_EMPLOYEEOPEN emFIRSTWHILE (@@fetch_status <> -1) BEGINPRINT @EMP_NUMBERFETCH NEXT FROM emFIRST INTO @EMP_NUMBER END CLOSE emFIRSTDEALLOCATE emFIRST
Configure the Formula with below or similar syntax according to the requirement. {HS_HR_EMPLOYEE.EMP_CALLING_NAME}+' '+{HS_HR_EMPLOYEE.EMP_SURNAME}+','+ right('0000000000000'+ltrim(rtrim({HS_PR_BANK_TRANSFERS.EBANK_ACC_NO})),13)+','+{HS_HR_BRANCH.BBRANCH_AUTO_CLR_HOUSE_CODE}+','+totext({HS_PR_BANK_TRANSFERS.EBT_AMOUNT},"0.00")+','+{HS_HR_EMPLOYEE.EMP_PAYROLLNO}
Step 1 : Right Click the MS SQL Data Base. Go --> Tasks --> Generate Scripts Step 2 : Click the Next button.Step 3 : Select the table/s data which you want to take as insert query. Then Click NextStep 4 : Click the advance button and select the Types of data to Scripts option and set it to the ...
My Requirement is :All employees have some value for TRN_DTL_CODE = '000003'Only few employees have value for TRN_DTL_CODE = '000124'I want the data view for the format of TRN_STARTDATE,TRN_ENDDATE,EMP_NUMBER, NSSF, VOL_NSSFNSSF = Value of TRN_DTL_CODE = '000003'VOL_NSSF = Value of TRN_DTL_CODE = '000124'I used LEFT OUTER JOIN for create this.CREATE VIEW VW_HS_PR_VOLUN_NSSF ASSELECT A.TRN_STARTDATE AS TRN_STARTDATE, A.TRN_ENDDATE AS TRN_ENDDATE , ...
My requirement is to order the contents of my selected SQL query. I can use ORDER BY for fulfill this task, but the problem is it will order my entire SQL query with ascending order or descending order according the way of using it. But my requirement is order the separate sub groups of my selected query. Let take this ...
My requirement is to rename the schema in selected tables/views.Let take a example like this.Existing table name - HRADMIN.VW_HR_EMPLOYEERequired table name - HRUSR. VW_HR_EMPLOYEEYou can simply do this by using below SQL command by login with sa account. Make sure your rename schema is exists under your Data Base. Otherwise you need to create it manually.ALTER SCHEMA <HRUSR> TRANSFER <HRADMIN>.< ...
CREATE FUNCTION HS_FN_LEV_APPROVING_PERSON_PARAPET (@EMP_NUMBER VARCHAR(6))RETURNS VARCHAR(6)AS BEGINDECLARE @EMPLOYEE AS VARCHAR(6)DECLARE @CORPORATE AS VARCHAR(6)DECLARE @SUP_EMPLOYEE AS VARCHAR(6)DECLARE @HR AS VARCHAR(6)DECLARE @HOD AS VARCHAR(6)DECLARE @CEO AS VARCHAR(6)DECLARE @APPROVER AS VARCHAR(6)SET @EMPLOYEE = @EMP_NUMBERSET @SUP_EMPLOYEE = ( SELECT EREP_SUP_EMP_NUMBER FROM HS_HR_EMP_REPORTTO WHERE EREP_REPORTING_MODE=1 AND EREP_SUB_EMP_NUMBER= @EMPLOYEE)SET @CORPORATE = (SELECT CT_CODE FROM HS_H