1
qryCIDtemp.SQL.Text := 'drop table if exists #tempCID'; //apaga a tabelas temporária
Delphi returns me the following message at runtime:
Invalid use of keyword Token: if Line Number: 1.
If anyone can help me, I’d be grateful.
EDIT:
Test with the suggested answer below:
I did as you suggested:
qryCIDtemp.SQL.Text := 'if object_id('#tempCID','U') Is not null drop table #tempCID'; //apaga a tabelas temporária
and it didn’t work either. Now the error is compilation. Delphi returns me:
Missing Operator or semicolon. Statement expected, but Expression of type 'String' found.
Have another idea?
Try:
IF OBJECT_ID('#tempCID') IS NOT NULL DROP TABLE #tempCID
– Dherik
Error messages were not returned by SQL Server but by Delphi.
– José Diz