Hi guys im having trouble with Null values in SQL
Create Procedure uspCheckParsandYards
@CourseName varchar(50),
@CheckPars int Output,
@NoOfHoles int Output,
@CheckYards int Output
AS
Declare @CourseID int = (Select CourseID From tblCourses Where CourseName = @CourseName)
Select @NoOfHoles = (Select tblCourses.NumberOfHoles From tblCourses Where CourseID = @CourseID)
Select @Checkpars = (Select ISNULL(tblPar.Hole1Par,'0') Hole1Par From tblPar
Where CourseID = @CourseID)
Select @CheckYards = (Select ISNULL(tblYards.Hole1Yds,'0') AS Hole1Yds From tblYards
Where CourseID = @CourseID)
if one of the Select statements returns no records i get a NULL value and i cant seem to figure how to convert it to something i can use either 0 or "". is this possible from within the query?
Create Procedure uspCheckParsandYards
@CourseName varchar(50),
@CheckPars int Output,
@NoOfHoles int Output,
@CheckYards int Output
AS
Declare @CourseID int = (Select CourseID From tblCourses Where CourseName = @CourseName)
Select @NoOfHoles = (Select tblCourses.NumberOfHoles From tblCourses Where CourseID = @CourseID)
Select @Checkpars = (Select ISNULL(tblPar.Hole1Par,'0') Hole1Par From tblPar
Where CourseID = @CourseID)
Select @CheckYards = (Select ISNULL(tblYards.Hole1Yds,'0') AS Hole1Yds From tblYards
Where CourseID = @CourseID)
if one of the Select statements returns no records i get a NULL value and i cant seem to figure how to convert it to something i can use either 0 or "". is this possible from within the query?