For the record, jOOQ 3.10 (and patch releases 3.9.3 and 3.8.8) will now
emulate DROP TABLE IF EXISTS [t2] (and similar) with the following
statement in SQL Server 2008:
begin try
drop table [t2]
end try
begin catch
if error_number() != 3701 begin
declare @ErrorMessage nvarchar(4000) = ERROR_MESSAGE();
declare @ErrorSeverity int = ERROR_SEVERITY();
declare @ErrorState int = ERROR_STATE();
raiserror (@ErrorMessage, @ErrorSeverity, @ErrorState);
end;
end catch
Am Montag, 11. Juli 2016 17:31:17 UTC+2 schrieb Lukas Eder:
>
> Hi Matthias,
>
> Thank you very much for bringing this to our attention. Indeed, the
> current implementation doesn't work with SQL Server 2008, only with 2012
> onwards. I have registered an issue to fix this:
> https://github.com/jOOQ/jOOQ/issues/5403
>
> I guess in 2008, we'll have to use raiserror instead...
>
> Thanks again for reporting,
> Lukas
>
> 2016-07-11 12:38 GMT+02:00 matscheer via jOOQ User Group <
> [email protected]>:
>
>> Hello together,
>>
>> i've created a 'create table' statement with
>> DSLCONTEXT.createTableIfNotExists (SQLDialect is set to SQLSERVER2008).
>>
>> jOOQ generates the following sql:
>>
>> begin try create table
>> ...
>> end try begin catch if error_number() != 2714 throw; end catch
>>
>> The execution of the Sql throws an SQLException:
>> com.microsoft.sqlserver.jdbc.SQLServerException: Falsche Syntax in der
>> Nähe von 'throw'.
>>
>> Throw Statement is only supported up to SQL Server 2012... isnt it?
>>
>> Greetings
>> Matthias
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "jOOQ User Group" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
You received this message because you are subscribed to the Google Groups "jOOQ
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.