Hello,
I've been playing with Torque and am really impressed. However, I had to
be a few things to get it to work against an mssql server; I'm not sure
if they're known or if what I did was the right thing to do, but for the
database I'm creating, it worked.
First, I removed an extra new line from:
templates/sql/base/mssql/primarykey.vm
This had been indirectly covered in one other mail I saw on the archive,
and when I checked the CVS repository, it looks like it might have been
fixed, but I just thought I'd mention it.
The other one was in:
templates/sql/base/mssql/table.vm
I had to change:
#if($strings.allEmpty([$unique]) &&
$pk.length()>0)$strings.chop($pk,2)#else$pk#end
to:
#if($table.printPrimaryKey().length()>0)
#if($strings.allEmpty([$unique]))$strings.chop($pk,2)#else$pk#end
#end
The reason being that in the first statement, even if I didn't have any
primary keys in the table, the else was getting executed, causing there
to be a primary key constraint in the generated SQL without any columns
in it.
The code I put it just ensures that the else is not executed when there
are no primary keys. Do note that I tried the more elegant
$pk.length()>0 in the first #if statement, but for some reason (and I
very well could have been doing something wrong), it kept returning true
even when I didn't have any primary keys. I just happened to try the
above #if statement and it worked.
I have not used any unique columns, but from my reading of the code, I
don't think my fix affects the lines directly above or below it.
- Stephen
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>