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
Something like this:
Declare @Name varchar()
Declare @This varchar()
SELECT @Name = Name,@This = This
from member
where membernumber 0
IF @name is 'blah'
Begin
Do Something here
end
if @this eq "that"
begin
Do something
end
Here's an example script I was given that show how you can loop through a
query using a cursor. Hope it helps.
Rick
USE Master
GO
DECLARE @DBname VarChar(50)
DECLARE DBCursor SCROLL CURSOR
FOR SELECT Name FROM Master..SysDatabases
ORDER BY Name
-- ORDER BY DBID
Regarding simple examples of stored procedures OT --
what should a very simple stored procedure that returns multiple resultsets
look like?
Lisa
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 09, 2001 12:36 PM
To: CF-Talk
Subject: RE: OT SQL
4 matches
Mail list logo