I have a TADOQuery
component which is connected to an SQL Server database using TADOConnection
.
Now, when I add below SQL to the component, and call ExecSql its raising proper exception, because there is a typo in the 'Create' word.
exec ('creat1e table myTable
(
col1 TPT_Dt not null ,
col2 TPT_FLOAT not null
)');
But the same statement, if I add it to another statement, then the TADOQuery component ignores this exception. E.g. :
select * from SomeOtherTable where id = 10
exec ('creat1e table myTable
(
col1 DtDataType not null ,
col2 FLOATDataType not null
)');
Could you please tell me why Delphi ignores the exception in the second case.
my issue is not with the select statement. even if i add an if condition then also same issue ;
for example
if not exists (select * from dbo.sysobjects where id = object_id('TABLE1278') and type='U')
begin
exec ('crea11te table table1278
(
col1 TPT_Dt
)');
end
delphi simply ignores the typo.
Thanks in advance.
Basil