Friday, December 2, 2022

Row number SQL without order by column

 SELECT

    ROW_NUMBER() OVER(ORDER BY (Select 0)) AS Row_Num,
    Employee_Name
    FROM MTB_Table_A


SELECT actid, tranid, val,
 ROW_NUMBER() OVER(ORDER BY (SELECT NULL)) AS rownum
FROM dbo.Transactions;



reference:- https://www.mytecbits.com/microsoft/sql-server/row-number-without-using-order-by

https://stackoverflow.com/questions/44105691/row-number-without-order-by

SQL Select query with no spaces

 select*from icms_employee

Update Stored Procedure with exist and insert

 USE [PMS]

GO

/****** Object:  StoredProcedure [dbo].[addleavedetails]    Script Date: 02-12-2022 11:39:13 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO


ALTER proc [dbo].[addleavedetails]

  @LeaveType nvarchar(100),

  @StartDate datetime,

  @EndDate datetime,

  @fmsid int,

  @id int

  as

  begin

  

  if (@id='')

  begin

  if not exists(select* from icms_leavedetails where fmsid=@fmsid and leavetype=@LeaveType and flag=1)begin

  insert into icms_leavedetails(LeaveType,flag,StartDate,EndDate,fmsid) values(@LeaveType,1,@StartDate,@EndDate,@fmsid)

  end

  else if (@LeaveType='EOL')

  begin 

  insert into icms_leavedetails(LeaveType,flag,StartDate,EndDate,fmsid) values(@LeaveType,1,@StartDate,@EndDate,@fmsid)

  end

  end

  else

Jquery ajax function with aspx page ASP.NET C#

reference:-  https://www.dotnetspider.com/forum/345776-Updating-database-on-button-click-from-email-body

ASP.NET tabs with ajax

 https://dotnetdrizzles.blogspot.com/2016/05/