Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Better syntax

Author  Topic 

sardinka
Posting Yak Master

142 Posts

Posted - 2006-04-04 : 12:32:26
Is it possible to have a better syntax for the following?
IF(SELECT dbo.udf_Validate ((SELECT ID FROM # temp WHERE RowID=@RowID),(SELECT CodeConfirm FROM # temp WHERE RowID=@RowID),(SELECT GROUP FROM # temp WHERE RowID=@RowID),GETDATE()))=1

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-04-04 : 12:52:03
Did u try the following:

Declare @ID varchar(100), @CodeConfirm varchar(100), @GROUP varchar(100) 
IF (SELECT dbo.udf_Validate (SELECT @ID = ID, @CodeConfirm = CodeConfirm, @GROUP = [GROUP], GETDATE() FROM # temp WHERE RowID=@RowID)=1


or

Declare @ID varchar(100), @CodeConfirm varchar(100), @GROUP varchar(100) 
SELECT @ID, @CodeConfirm, @CodeConfirm, @GROUP FROM # temp WHERE RowID=@RowID
IF (@ID, @CodeConfirm, @GROUP, )= 1


Srinika
Go to Top of Page
   

- Advertisement -