Friday, 17 May 2024

Add and Update bulk records to table in sql using UDDT(userdefined datatables)


                GLCode,

                CreatedBy,

                ModifiedBy,

                CreatedOn,

                ModifiedOn

            )

            VALUES (

                Source.PurchaseOrderId,

                Source.Quantity,

                Source.UnitPrice,

                Source.Description,

                Source.GLDescriptionId,

                Source.GLCode,

                Source.CreatedBy,

                Source.ModifiedBy,

                ISNULL(Source.CreatedOn, GETDATE()),

                ISNULL(Source.ModifiedOn, GETDATE())

            );


        -- Handle deletions if necessary (optional)

        -- WHEN NOT MATCHED BY SOURCE THEN

        --    DELETE;


        -- Return a success message

        SELECT 1 AS [Status], 'Items have been added/updated successfully.' AS [Message];

    

    END TRY

    BEGIN CATCH

        -- Handle any errors

        SELECT 

            ERROR_NUMBER() AS ErrorNumber,

            ERROR_SEVERITY() AS ErrorSeverity,

            ERROR_STATE() AS ErrorState,

            ERROR_PROCEDURE() AS ErrorProcedure,

            ERROR_LINE() AS ErrorLine,

            ERROR_MESSAGE() AS ErrorMessage;


        -- You might want to re-throw the error

        -- THROW;

    END CATCH

END;

Monday, 13 May 2024

Change the text cursor/caret in Visual Studio

 

Change the text cursor/caret in Visual Studio


Change Box cursor to Line cursor or bar cursor in vsstudion use
insert key in keyboard

Angular material pagination

 Angular material pagination not working in few condition. show below condition working fine.

   this.dsprpo = new MatTableDataSource<approvalPending>(this.lstrepopo);
      this.cdr.detectChanges();

private cdr: ChangeDetectorRef,

Thursday, 9 May 2024

wrap text in excel

 if text length big make it next line shorcut is ALt+Enter

or

cilck on wrap text


Monday, 6 May 2024

angular parent to child

 When you are using parent child relation you like to pass

data from parent to data.

but child template intialized before getting data from api side.

to over come this we use noOnchanges in child class to get data after api call also the data will be added


@input child:childpage;

<child [child]="reslult" ></child>

sql filter data wiht null values

 if you want to get all records if pass null and any id then check department id.
here if pass null initally you will get all data. other wise based on departmentid you will get the data

WHERE         

   (H.DisplayName LIKE '%' + @search + '%'         

   OR H.User_ID LIKE '%' + @search + '%'         

   OR H.EmpNo LIKE '%' + @search + '%'         

   )        

   AND H.IsActive = 1        

   AND UAE.RoleCode IN ('SuperAdmin', 'DepartmentAdmin', 'Approver')     

   AND (@departmentID IS NULL OR UAE.Department_ID = @departmentID)  

junior devops engnr

  Position Overview: We are a growing start up seeking a Junior Azure DevOps Engineer with 2 to 3 years of experience to support our Azure...