What do you mean by OT?
I know that on MS SQL Server, it does not allow you to
break up a sql statement like that. Making the
assumption that the rule applies and is the same on
other db's.
you would have to do it like this:
create proc test1 @groupid int
if @groupid = 0
begin
select * from
WITH THE IF/ELSE/ on Stored Procedures is there a way to write a storedproc
so it was like this
SELECT *
from member
where membernumber 0
IF @name is "0"
and name='blah'
end
if @this eq "that"
and that='test'
end
to make it only run certain things if certain values are set
Bill Wheatley
end
-Original Message-
From: William J Wheatley [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 24, 2001 12:20 PM
To: CF-Talk
Subject: OT SQL STORED PROCEDURES
WITH THE IF/ELSE/ on Stored Procedures is there a way to write a storedproc
so it was like this
SELECT *
from me
FETCH NEXT FROM DBCursor INTO @DBName
END
CLOSE DBCursor
DEALLOCATE DBCursor
SET NOCOUNT OFF
-Original Message-
From: William J Wheatley [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 24, 2001 12:20 PM
To: CF-Talk
Subject: OT SQL STORED PROCEDURES
WITH THE IF/ELSE/ on Stored
tmpUserTable
FETCH NEXT FROM DBCursor INTO @DBName
END
CLOSE DBCursor
DEALLOCATE DBCursor
SET NOCOUNT OFF
-Original Message-
From: William J Wheatley [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 24, 2001 12:20 PM
To: CF-Talk
Subject: OT SQL STORED PROCEDURES
Hi,
Just wondering if anyone can help with a SQL Server 7 Stored Procedure
question.
I have a stored procedure that returns a group of fields from a
table. What I'd like to do is return a field which is the result of
another stored procedure that does something to one of the fields from
6 matches
Mail list logo