Friday, February 23, 2024

Stored procedure for Search or Filter in sql

 ALTER PROCEDURE [dbo].[SSP_GetAllTest]

@UserOfficeId bigint,

@RoleId bigint,

@ApplicationNo nvarchar(50) = '',

@RCNo nvarchar(50) = '',

@ApplicationTypeId int = 0,

@Status int = -1,  -- -1 for selct All, 0 for Active/Pending, 1 for Disposed

@BranchOfficeId bigint = 0,

@ZoneId bigint = 0

How to Fix Error Code: Out of Memory in Chrome, Edge, Firefox - Computer speed is slow - to fast the computer speed

 chrome://restart

storage system in start search

    Thursday, February 22, 2024

    Accordion bootstrap, Updatepanel ASP.NET

    <asp:UpdatePanel runat="server" ID="updatePanelAppeals" UpdateMode="Conditional">

    <Triggers>

                    <asp:AsyncPostBackTrigger ControlID="btnSearch" />

                </Triggers>

    </asp:UpdatePanel >

    or


    updatePanelAppeals.Update();


    we can use one from this. or in every update panel we have to add triggers.

     https://getbootstrap.com/docs/5.0/components/accordion/


    https://learn.microsoft.com/en-us/dotnet/api/system.web.ui.asyncpostbacktrigger?view=netframework-4.8.1

    Wednesday, February 21, 2024

    how to pass parameter of stored procedure or parameter of function as datetime

     select dbo.Age (convert(varchar, '01/02/2000',105) )  -- date as mm/dd/yyyy



    ref:- https://stackoverflow.com/questions/8694503/how-to-pass-the-datetime-value-as-parameter-to-a-stored-procedure

    How to create Temporary table in SQL - Temp table - with drop temp table -CTE - common temp table

     WITH OfficeHierarchy AS 

        (

            -- Anchor member (initial data)

            SELECT TableID, OffName, OffType, ParentID

            FROM M_OfficeMaster

            WHERE TableID = @OfficeID  

    )

    SELECT * FROM OfficeHierarchy


    Not :- This above will not work in if and else conditions


    Use below code

    SELECT 

    ChargeSheetId

    ,CourtCaseNumber

    ,[Date] AS ChSheetDate

    ,DisposalDate

    ,CnrNumber

    INTO #ChargeSheets

    FROM ChargeSheet 

    WHERE OfficeId= @OfficeId AND FIRNumber = @RCNumber 

    AND IsActive=1;


    DROP TABLE IF EXISTS #ChargeSheets