|
-
March 5th, 2009, 02:15 AM
#4
Re: Help with the SQL Query
 Originally Posted by vuyiswam
Thank you for your Help. i did it this way and its working.
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)
IF @Pattern is null Set @Pattern = '00000000'Select @Pattern
Thank you
Well - that approach seem to violate your first listed example, but it might be because of a bug in the first.
Because your first - the requirement was the pattern had to be larger then 1 in length so it had to be 2 characters or more.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|