Why can't I execute this script in ADO?
From: Petar Petrovic (mojne_at_uznemiravati.me)
Date: 01/23/04
- Previous message: Marc Scheuner: "Re: D8: Beginning ADO.NET App"
- Next in thread: Martijn Tonies: "Re: Why can't I execute this script in ADO?"
- Reply: Martijn Tonies: "Re: Why can't I execute this script in ADO?"
- Reply: Dennis: "Re: Why can't I execute this script in ADO?"
- Reply: Dennis: "Re: Why can't I execute this script in ADO?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 23 Jan 2004 08:26:01 +0100
I've tried to execute following script in ADOCommand but unsuccsessfully :-(
--------- SCRIPT BEGIN ----------
if exists ( select 1
from sysobjects
where name = 'prProc1'
and type = 'P')
drop procedure prProc1
go
create procedure prProc1
(
@CategoryID int
)
as
if ( @CategoryID = -1 )
begin
select
CategoryID,
CategoryName,
Description,
Picture
from
"Categories"
end
else
begin
select
CategoryID,
CategoryName,
Description,
Picture
from
"Categories"
where
CategoryID = @CategoryID
end
go
if exists ( select 1
from sysobjects
where name = 'prProc2'
and type = 'P')
drop procedure prProc2
go
create procedure prProc2
(
@CategoryName nvarchar(15),
@Description ntext,
@Picture image
)
as
insert into "Categories"( CategoryName, Description, Picture )
values( @CategoryName, @Description, @Picture )
go
--------- SCRIPT END ----------
Then I removed 'GO' from the script but I received an error that "CREATE
PROCEDURE must be first statement".
Is there a way to execute such things in Delphi applications anyway?
Thanks and regards!
- Previous message: Marc Scheuner: "Re: D8: Beginning ADO.NET App"
- Next in thread: Martijn Tonies: "Re: Why can't I execute this script in ADO?"
- Reply: Martijn Tonies: "Re: Why can't I execute this script in ADO?"
- Reply: Dennis: "Re: Why can't I execute this script in ADO?"
- Reply: Dennis: "Re: Why can't I execute this script in ADO?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]