Re: OT SQL STORED PROCEDURES

2001-01-24 Thread S C
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

RE: OT SQL STORED PROCEDURES

2001-01-09 Thread Clint Tredway
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

RE: OT SQL STORED PROCEDURES

2001-01-09 Thread Rick Lamb
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

RE: OT SQL STORED PROCEDURES

2001-01-09 Thread LKHaas
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