[RESOLVED] Help with the SQL Query
Good Day All
I have the Following SP
Code:
ALTER PROC GET_BASED_PATTERN
(
@SUBJECT VARCHAR(30),
@Pattern nvarchar(128) output
)
AS
SET @Pattern = (SELECT TOP 1 TERM.[CYCLETEMPLATES]FROM tbl_term TERM
INNER JOIN dbo.TBL_ACTV v
on TERM.ID = V.TERM
INNER JOIN DBO._Subjects S
ON V.TERM = S.[LEVEL]
WHERE CODE = @SUBJECT)
SELECT
CASE
WHEN LEN(@Pattern) > 1 THEN @Pattern
ELSE '00000000'
END
It returns
and NUll at the Bottom if the len is not greater than 1. i want it to return 00000000 if its like that.
Thank you
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."