if @BclsExpires between getdate() and getdate()+ 60
begin
select @WillExpire = @WillExpire + ', Bcls'
select @IsBclsDate = 1
end
if @AclsExpires between getdate() and getdate()+ 60
begin
select @WillExpire = @WillExpire + ', Acls'
select @IsAclsDate = 1
end
if @NalsExpires between getdate() and getdate()+ 60
begin
select @WillExpire = @WillExpire + ', Nals'
select @IsNalsDate = 1
end
if @PalsExpires between getdate() and getdate()+ 60
begin
select @WillExpire = @WillExpire + ', Pals'
select @IsPalsDate = 1
end
Basically I'm looking for some hints on how to debug this, as I'm using SQL 2005 where I cannot use debuggers tools..ASKER
and add DECLARE keyword on top of the function parameters. Then simply add parameter valuesCan you give me example of how it looks like?
and you may start debugging.How? I would love to have the ability to step into code line by line (like I have in VBA) however as mentioned my SQL version doesn't support it..
To tell why it does not work for you we would need parameter values used for the function call.I may get that for you shortly
ASKER
SELECT * FROM fn_frmJcahoReportsFrm(562,571) WHERE Facility1_LastDay >= '1/20/2017' AND ID = 148223 ORDER BY JcahoDueDate
Any idea how to get all params being sent from my app?ASKER
Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.
TRUSTED BY
You may debug this function simply in SSMS:
Place the whole function to the New query window, remove lines which define the function:
ALTER FUNCTION [dbo].[EmployeesMissingDoc
) RETURNS VARCHAR(2000)
AS
and add DECLARE keyword on top of the function parameters. Then simply add parameter values and you may start debugging.
The whole function is a candidate to rewrite. You shouldn't use special parameters for each piece of document/measurement/value