Create Store Procedure From Delphi

I am trying to create a store procedure from my Delphi program. I use an ADOComand to execute the procedure create script.I find 2 problems...if i do not use GO in my statement in script i get error becouse 'Create Procedure' must be firs and if i use GO i get 'Incorect syntax near GO statement error'. EOLEException Error. In SQL Querry Analizer the script work fine so...what could be the problem ?.or...how elese can i create my procedure at program runtime ?...thanks you all
dannertbAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dannertbAuthor Commented:
By the way ..Database Server is MSSQLServer 2000
0
pcsentinelCommented:
Dont use GO, I just tried it with an ADOCommand and a ADOConnection,

in the ADOCommand  Text property I had

CREATE PROCEDURE LISTALL AS
SELECT * FROM TestTable

the commandtype was set to cmdText

then on a button I just had

ADOCommand1.execute and it worked ok
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dannertbAuthor Commented:
ExecuteInit:=TADOCommand.Create(main);
 ExecuteInit.Connection:=Conn;
 ExecuteInit.CommandType:=cmdText;
 ExecuteInit.ParamCheck := False;
 ExecuteInit.CommandText:=Memo1.Text;
 ExecuteInit.Execute;
 ExecuteInit.Free;

It worked OK in this way...my problem was that i wanted to create more than one procedure in one script...but separtely it works fine...10x
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.