1

Since SQL Server does not have a simple batch command line executor for the scripts the are auto generated from management studio, I created one.

The problem arises when delphi ado syntax and SQL Server syntax don't agree (BUT ITS THE SAME THING).

Well any how, the go I replaced with ;

Now as I declare a stored procedure alter, I hit a brick wall.

The script I'm running is :

ALTER Procedure [dbo].[procName]
as
Declare @param int

and the error i get is :

the arguments are from the wrong type, out of range or collide with one another.

(my free translation)

questions :

  • why is this happening?
  • what can i do to change this?
  • is there another udl based program that parse SQL scripts?

thanks.

edit: require login to the db with udl file.

could it be that delphi has problems with @ ?

3
  • That ALTER PROCEDURE statement seems quite incomplete.... can you please post the full SQL script you're trying to execute there?? Commented Nov 7, 2010 at 11:01
  • first, i want to thank you for your time, unfortunately that is the statement that the user was trying to do, when he referred to me with error. that statement itself is running successfully on sql management studio well. looking at the statement it sure is bizarre. Commented Nov 8, 2010 at 11:37
  • what about doint a wrapper for sqlcmd that will connect throw udl file and send to sqlcmd.exe the sql command, the knowlage how to connect to the db? Commented Nov 8, 2010 at 15:35

3 Answers 3

3

Since SQL Server does not have a simple batch command line executer for the scripts the are auto generated from management studio, I created one.

Are you aware of SQLCMD ?? Seems like a command-line utility to execute SQL scripts to me... also: the SQLCMD utility has a number of additional enhancements that go beyond what the T-SQL scripts in SSMS can do.

Also check out:

Sign up to request clarification or add additional context in comments.

1 Comment

thank you, however sqlCmd does not answer a requirement. USE A UDL CONNECTION. since there is a need to pick the sql server dynamically then its a problem to find out what is the instance name, or what is the login method. udl connection is priceless.
1

Not sure about your SQL example above, but does the stored procedure actually have any parameters, or are you calling a variable inside the body @param? The usual syntax is:

ALTER Procedure [dbo].[procName]
(<@params here>)
AS
<body + variables here>

MSDN - Alter Procedure

1 Comment

its runs under ms sql sever 2008. check it. its like in c you say int func(){ int i;} its legal
0

removed the component and change the code from

ado.open;

to

ado.execute;//or something like this

solved it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.