You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ddlutils-user@db.apache.org by Jun Li <al...@gmail.com> on 2006/07/20 03:44:18 UTC

Consider table specific variable names.

 I was going to run the sql script generated from
Platform.getCreateTablesSql() on SQL Server 2000, however, the SQL Query
Analyzer complains about the variable names declared in the script.

"The variable name '@tablename' has already been declared. Variable names
must be unique within a query batch or stored procedure."

This variable came from MSSqlBuilder.dropTable().

I thought DdlUtils might need to use table specific variables in
this kind of statement so that the sql generated can be run on DB directly
rather than through JDBC.


--------------
Cheers,
Jun

Re: Consider table specific variable names.

Posted by Jun Li <al...@gmail.com>.
On 7/20/06, Thomas Dudziak <to...@gmail.com> wrote:
>
> I've introduced unique variable names which should work (it does on my
> local Sql Server 2005). Could you give it a try ?
>
> Tom
>

Verified on SQL Server 2000, it works beautifully.

Thanks.


-- 
--------------
Cheers,
Jun

Re: Consider table specific variable names.

Posted by Thomas Dudziak <to...@gmail.com>.
I've introduced unique variable names which should work (it does on my
local Sql Server 2005). Could you give it a try ?

Tom

Re: Consider table specific variable names.

Posted by Jun Li <al...@gmail.com>.
>
>
> Yes, sure. Can you perhaps send me the SQL so that I can debug this ?
>
> Tom
>
Here is a portion of the script.

Thanks.

-- 
--------------
Cheers,
Jun

Re: Consider table specific variable names.

Posted by Thomas Dudziak <to...@gmail.com>.
On 7/19/06, Jun Li <al...@gmail.com> wrote:

>  I was going to run the sql script generated from
> Platform.getCreateTablesSql() on SQL Server 2000, however, the SQL Query
> Analyzer complains about the variable names declared in the script.
>
> "The variable name '@tablename' has already been declared. Variable names
> must be unique within a query batch or stored procedure."
>
> This variable came from MSSqlBuilder.dropTable().
>
> I thought DdlUtils might need to use table specific variables in
> this kind of statement so that the sql generated can be run on DB directly
> rather than through JDBC.

Yes, sure. Can you perhaps send me the SQL so that I can debug this ?

Tom