Tuesday, February 22, 2022

Books

https://drive.google.com/drive/folders/1zkfruc32NTZedTcKsxlRoKsBi8sqD_dO?usp=sharing

Thursday, February 17, 2022

INFORMATION_SCHEMA.ROUTINES Find Word FROM

 SELECT ROUTINE_NAME, ROUTINE_DEFINITION , ROUTINE_TYPE

FROM INFORMATION_SCHEMA.ROUTINES 

WHERE ROUTINE_DEFINITION LIKE '%INSERT INTO gcpf.Collection%' 

AND ROUTINE_TYPE='PROCEDURE'

ORDER BY ROUTINE_NAME





Wednesday, February 16, 2022

Find word in all stored procedure.

 SELECT OBJECT_NAME(OBJECT_ID) AS ObjectName,

       definition             AS ObjectDefinition

 FROM   sys.sql_modules 

WHERE  definition LIKE '%Collection%'

Tuesday, February 8, 2022

Resume

 resume

Delete if Duplicate Rows exist in Table

 

The following statement uses a common table expression (CTE) to delete duplicate rows: 



WITH cte AS (

    SELECT 

   SalaryYear, SalaryMonth, SalaryDate, OfficeID, EmployeeID,

   PRComponentID, PRTranTypeID,

   IsPosted, IsActive,

        ROW_NUMBER() OVER (

            PARTITION BY 

                SalaryYear, SalaryMonth, SalaryDate, OfficeID, EmployeeID,

   PRComponentID, PRTranTypeID,

   IsPosted, IsActive

            ORDER BY 

                SalaryYear, SalaryMonth, SalaryDate, PRSalaryConfigurationID, OfficeID, EmployeeID,

   PRComponentID, ComponentAmount, PRTranTypeID,

   IsPosted, IsActive

        ) row_num

     FROM 

        PRSalaryRegister

WHERE 

   SalaryMonth = 5 AND

    SalaryYear = 2020 AND 

EmployeeId = 46061


)

DELETE FROM cte

WHERE row_num > 1;






--SELECT * INTO PRSalaryRegister_8_February_2022 FROM PRSalaryRegister

Screen Record

 Windows Screen Record WindowsKey+ Alt + R Recording Starts.