I'm currently facing a dilemma where I need to assign a Null value to a uniqueidentifier variable in a stored procedure. The issue arises when attempting to pass an empty string to the variable, resulting in the error message "Cannot convert varchar to uniqueidentifier". While executing the procedure in SQL Server everything functions properly, but TypeScript triggers the aforementioned error...
Below is the executed procedure code:
USE [CMS_ONE]
GO
DECLARE @return_value int
EXEC @return_value = [dbo].[PrAdmissionReports]
@session = '82c16d40-56ba-4e5a-b6f4-8f3767fc48fa',
@campus = '0EF13205-3150-43F3-A37A-CDE57BFD544E',
@program = '929A0FCD-81C8-44D3-AC56-020E7C0AA2B2',
@fromDate = '2018-07-02',
@toDate = '2018-07-27'
SELECT 'Return Value' = @return_value
GO
I've been trying to pass @program as ProgramDetailID = null to the procedure, however, the error persists.
This is how I'm passing the values from the front-end:
this.sessionID +
"," +
this.campusID +
"," +
this.programDetailID +
"," +
this.fromDate +
"," +
this.toDate
Any assistance on this matter would be greatly appreciated